Skip to content

Commit

Permalink
fix: checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Oct 21, 2024
1 parent e72f4fa commit b5d5bab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class NameHandler implements INetworkSync {
private static final Map<StateInfo, List<NameStateListener>> TASKS_WHEN_LOAD = new HashMap<>();
private static final Map<StateInfo, List<LoadHolder<?>>> 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;

Expand Down Expand Up @@ -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<LoadHolder<?>> list = new ArrayList<>();
list.add(new LoadHolder<>(creator));
Expand All @@ -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);
}
Expand Down Expand Up @@ -346,7 +346,7 @@ public static void loadName(final StateLoadHolder holder, final @Nullable Player
public static void loadNames(final List<StateLoadHolder> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SignalStateInfo, Map<SEProperty, String>> CURRENTLY_LOADED_STATES = new HashMap<>();
private static final Map<Level, SignalStateFileV2> ALL_LEVEL_FILES = new HashMap<>();
private static final Map<SignalStateInfo, List<LoadHolder<?>>> SIGNAL_COUNTER = new HashMap<>();
Expand Down Expand Up @@ -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<LoadHolder<?>> list = new ArrayList<>();
list.add(new LoadHolder<>(creator));
synchronized (SIGNAL_COUNTER) {
Expand Down Expand Up @@ -237,7 +237,7 @@ public static void setStates(final SignalStateInfo info, final Map<SEProperty, S
}
}
updateListeners(info, changedProperties, ChangedState.UPDATED);
threadService.execute(() -> {
THREAD_SERVICE.execute(() -> {
sendToAll(info, changedProperties);
info.signal.getUpdate(info.world, info.pos);
if (!contains.get())
Expand Down Expand Up @@ -542,7 +542,7 @@ public static void loadSignals(final List<SignalStateLoadHoler> 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) {
Expand Down

0 comments on commit b5d5bab

Please sign in to comment.