diff --git a/src/main/java/com/troblecodings/signals/handler/NameHandler.java b/src/main/java/com/troblecodings/signals/handler/NameHandler.java index f6c5f5018..bd710ef7f 100644 --- a/src/main/java/com/troblecodings/signals/handler/NameHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/NameHandler.java @@ -53,7 +53,7 @@ public final class NameHandler implements INetworkSync { private static ExecutorService writeService = Executors.newFixedThreadPool(5); - private static final ExecutorService threadService = Executors.newCachedThreadPool(); + private static final ExecutorService THREAD_SERVICE = Executors.newCachedThreadPool(); private static final Map ALL_NAMES = new HashMap<>(); private static final Map ALL_LEVEL_FILES = new HashMap<>(); private static final Map> TASKS_WHEN_LOAD = new HashMap<>(); @@ -85,7 +85,7 @@ public static void createName(final StateInfo info, final String name, final EntityPlayer creator) { if (info.world.isRemote || name == null) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { setNameForNonSignal(info, name); final List> list = new ArrayList<>(); list.add(new LoadHolder<>(creator)); @@ -110,7 +110,7 @@ public static void setNameForSignal(final StateInfo info, final String name) { public static void setNameForNonSignal(final StateInfo info, final String name) { if (info.world.isRemote || name == null) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { synchronized (ALL_NAMES) { ALL_NAMES.put(info, name); } @@ -323,7 +323,7 @@ public static void loadNames(final List infos, final @Nullable EntityPlayer player) { if (infos == null || infos.isEmpty()) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { infos.forEach(info -> { boolean isLoaded = false; synchronized (LOAD_COUNTER) { diff --git a/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java b/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java index 12c2218af..b5b3be404 100644 --- a/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java @@ -56,7 +56,7 @@ private SignalStateHandler() { } private static ExecutorService writeService = Executors.newFixedThreadPool(5); - private static final ExecutorService threadService = Executors.newCachedThreadPool(); + private static final ExecutorService THREAD_SERVICE = Executors.newCachedThreadPool(); private static final Map> CURRENTLY_LOADED_STATES = new HashMap<>(); private static final Map ALL_LEVEL_FILES = new HashMap<>(); private static final Map>> SIGNAL_COUNTER = new HashMap<>(); @@ -91,7 +91,7 @@ public static void createStates(final SignalStateInfo info, CURRENTLY_LOADED_STATES.put(info, ImmutableMap.copyOf(states)); } updateListeners(info, states, ChangedState.ADDED_TO_FILE); - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { final List> list = new ArrayList<>(); list.add(new LoadHolder<>(creator)); synchronized (SIGNAL_COUNTER) { @@ -254,7 +254,7 @@ public static void setStates(final SignalStateInfo info, final Map { + THREAD_SERVICE.execute(() -> { sendToAll(info, changedProperties); info.world.getMinecraftServer() .addScheduledTask(() -> info.signal.getUpdate(info.world, info.pos)); @@ -533,7 +533,7 @@ public static void loadSignals(final List signals, final @Nullable EntityPlayer player) { if (signals == null || signals.isEmpty()) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { signals.forEach(info -> { boolean isLoaded = false; synchronized (SIGNAL_COUNTER) {