Skip to content

Commit

Permalink
ref: checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Oct 21, 2024
1 parent 0e29633 commit 2d28a3c
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 @@ -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<StateInfo, String> ALL_NAMES = new HashMap<>();
private static final Map<World, NameHandlerFileV2> ALL_LEVEL_FILES = new HashMap<>();
private static final Map<StateInfo, List<NameStateListener>> TASKS_WHEN_LOAD = new HashMap<>();
Expand Down Expand Up @@ -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<LoadHolder<?>> list = new ArrayList<>();
list.add(new LoadHolder<>(creator));
Expand All @@ -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);
}
Expand Down Expand Up @@ -323,7 +323,7 @@ public static void loadNames(final List<StateLoadHolder> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SignalStateInfo, Map<SEProperty, String>> CURRENTLY_LOADED_STATES = new HashMap<>();
private static final Map<World, SignalStateFileV2> ALL_LEVEL_FILES = new HashMap<>();
private static final Map<SignalStateInfo, List<LoadHolder<?>>> SIGNAL_COUNTER = new HashMap<>();
Expand Down Expand Up @@ -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<LoadHolder<?>> list = new ArrayList<>();
list.add(new LoadHolder<>(creator));
synchronized (SIGNAL_COUNTER) {
Expand Down Expand Up @@ -254,7 +254,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.world.getMinecraftServer()
.addScheduledTask(() -> info.signal.getUpdate(info.world, info.pos));
Expand Down Expand Up @@ -533,7 +533,7 @@ public static void loadSignals(final List<SignalStateLoadHoler> 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) {
Expand Down

0 comments on commit 2d28a3c

Please sign in to comment.