From bba75793ddf767819a3fa81ee96b529e9e30220a Mon Sep 17 00:00:00 2001 From: Zontreck Date: Sun, 18 Feb 2024 09:22:41 -0700 Subject: [PATCH] Attempt to fix a null error --- .../ariaslib/util/DelayedExecutorService.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/dev/zontreck/ariaslib/util/DelayedExecutorService.java b/src/main/java/dev/zontreck/ariaslib/util/DelayedExecutorService.java index fb44318..af4fc70 100644 --- a/src/main/java/dev/zontreck/ariaslib/util/DelayedExecutorService.java +++ b/src/main/java/dev/zontreck/ariaslib/util/DelayedExecutorService.java @@ -21,6 +21,12 @@ public class DelayedExecutorService { static{ inst=new DelayedExecutorService(); repeater = new ScheduledThreadPoolExecutor(16); + repeater.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + DelayedExecutorService.getInstance().onTick(); + } + }, 1L, 1L, TimeUnit.SECONDS); } private DelayedExecutorService(){} @@ -45,14 +51,9 @@ public class DelayedExecutorService { /** * This function is designed to set back up the executor if it was previously stopped and restarted. */ + @Deprecated public static void setup() { - repeater.scheduleAtFixedRate(new Runnable() { - @Override - public void run() { - DelayedExecutorService.getInstance().onTick(); - } - }, 1L, 1L, TimeUnit.SECONDS); } /** @@ -143,10 +144,6 @@ public class DelayedExecutorService { public void onTick() { - if(!isRunning()) - { - DelayedExecutorService.stopRepeatingThread(); - } /*Iterator it = EXECUTORS.iterator(); try{