diff --git a/gradle.properties b/gradle.properties index 1ae409c..d8733f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,5 +5,5 @@ org.gradle.daemon=false mc_version=1.18.2 forge_version=40.2.1 -myversion=1.0.5.0228230758 +myversion=1.0.5.0228230829 parchment_version=2022.11.06 \ No newline at end of file diff --git a/src/main/java/dev/zontreck/libzontreck/util/DelayedExecutorService.java b/src/main/java/dev/zontreck/libzontreck/util/DelayedExecutorService.java index 8549df0..ba284cc 100644 --- a/src/main/java/dev/zontreck/libzontreck/util/DelayedExecutorService.java +++ b/src/main/java/dev/zontreck/libzontreck/util/DelayedExecutorService.java @@ -44,11 +44,24 @@ public class DelayedExecutorService { public List EXECUTORS = new ArrayList<>(); - public void schedule(Runnable run, int seconds) + public void schedule(final Runnable run, int seconds) { - long unix = Instant.now().getEpochSecond()+ (seconds); - DelayedExecution exe = new DelayedExecution(run,unix); - EXECUTORS.add(exe); + //long unix = Instant.now().getEpochSecond()+ (seconds); + TimerTask task = new TimerTask() { + @Override + public void run() + { + run.run(); + } + }; + repeater.schedule(task, seconds*1000L); + //DelayedExecution exe = new DelayedExecution(run,unix); + //EXECUTORS.add(exe); + } + + private static void stopRepeatingThread() + { + repeater.cancel(); } public void onTick() @@ -56,10 +69,10 @@ public class DelayedExecutorService { if(!LibZontreck.ALIVE) { LibZontreck.LOGGER.info("Tearing down delayed executor service"); - + DelayedExecutorService.stopRepeatingThread(); return; } - Iterator it = EXECUTORS.iterator(); + /*Iterator it = EXECUTORS.iterator(); while(it.hasNext()) { DelayedExecution e = it.next(); @@ -70,7 +83,7 @@ public class DelayedExecutorService { tx.setName("DelayedExecutorTask-"+String.valueOf(DelayedExecutorService.getNext())); tx.start(); } - } + }*/ } public static int getNext() diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index e81df48..53d965d 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -19,7 +19,7 @@ modId="libzontreck" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it # ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata # see the associated build.gradle script for how to populate this completely automatically during a build -version="1.0.5.0228230758" #mandatory +version="1.0.5.0228230829" #mandatory # A display name for the mod displayName="LibZontreck" #mandatory # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/