diff --git a/src/main/java/com/troblecodings/signals/handler/NameHandler.java b/src/main/java/com/troblecodings/signals/handler/NameHandler.java index 116656fc5..61cdb2eba 100644 --- a/src/main/java/com/troblecodings/signals/handler/NameHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/NameHandler.java @@ -58,7 +58,7 @@ public final class NameHandler implements INetworkSync { private static final Map> TASKS_WHEN_LOAD = new HashMap<>(); private static final Map>> LOAD_COUNTER = new HashMap<>(); private static ExecutorService writeService = Executors.newFixedThreadPool(5); - private static final ExecutorService threadService = Executors.newCachedThreadPool(); + private static final ExecutorService THREAD_SERVICE = Executors.newCachedThreadPool(); private static EventNetworkChannel channel; private static ResourceLocation channelName; @@ -93,7 +93,7 @@ public static void registerToNetworkChannel(final Object obj) { public static void createName(final StateInfo info, final String name, final Player creator) { if (info.world.isClientSide || name == null) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { setNameForNonSignal(info, name); final List> list = new ArrayList<>(); list.add(new LoadHolder<>(creator)); @@ -118,7 +118,7 @@ public static void setNameForSignal(final StateInfo info, final String name) { public static void setNameForNonSignal(final StateInfo info, final String name) { if (info.world.isClientSide || name == null) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { synchronized (ALL_NAMES) { ALL_NAMES.put(info, name); } @@ -346,7 +346,7 @@ public static void loadName(final StateLoadHolder holder, final @Nullable Player public static void loadNames(final List infos, final @Nullable Player 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 574824769..719c410e0 100644 --- a/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java @@ -55,7 +55,7 @@ public final class SignalStateHandler 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> CURRENTLY_LOADED_STATES = new HashMap<>(); private static final Map ALL_LEVEL_FILES = new HashMap<>(); private static final Map>> SIGNAL_COUNTER = new HashMap<>(); @@ -104,7 +104,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) { @@ -237,7 +237,7 @@ public static void setStates(final SignalStateInfo info, final Map { + THREAD_SERVICE.execute(() -> { sendToAll(info, changedProperties); info.signal.getUpdate(info.world, info.pos); if (!contains.get()) @@ -542,7 +542,7 @@ public static void loadSignals(final List signals, final @Nullable Player player) { if (signals == null || signals.isEmpty()) return; - threadService.execute(() -> { + THREAD_SERVICE.execute(() -> { signals.forEach(info -> { boolean isLoaded = false; synchronized (SIGNAL_COUNTER) {