Skip to content

Commit eae10ef

Browse files
committed
Merge remote-tracking branch 'origin/master-1.21-lts' into master-1.21
2 parents f84628b + 3e8346a commit eae10ef

8 files changed

Lines changed: 61 additions & 30 deletions

File tree

CHANGELOG-1.19.2.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# Changelog for Minecraft 1.19.2
22
All notable changes to this project will be documented in this file.
33

4+
<a name="1.19.2-1.6.13"></a>
5+
## [1.19.2-1.6.13](/compare/1.19.2-1.6.12...1.19.2-1.6.13) - 2025-11-16 15:22:42
6+
7+
8+
### Fixed
9+
* Fix serialize threads not closing after terminal is closed
10+
This makes sure that thread pools are localized per container, and
11+
is closed once the container is closed.
12+
Closes #185
13+
414
<a name="1.19.2-1.6.12"></a>
5-
## [1.19.2-1.6.12](/compare/1.19.2-1.6.11...1.19.2-1.6.12) - 2025-11-11 14:55:56
15+
## [1.19.2-1.6.12](/compare/1.19.2-1.6.11...1.19.2-1.6.12) - 2025-11-11 14:55:56 +0100
616

717

818
### Fixed

CHANGELOG-1.20.1.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# Changelog for Minecraft 1.20.1
22
All notable changes to this project will be documented in this file.
33

4+
<a name="1.20.1-1.6.13"></a>
5+
## [1.20.1-1.6.13](/compare/1.20.1-1.6.12...1.20.1-1.6.13) - 2025-11-16 15:28:48
6+
7+
8+
### Fixed
9+
* Fix serialize threads not closing after terminal is closed
10+
This makes sure that thread pools are localized per container, and
11+
is closed once the container is closed.
12+
Closes #185
13+
414
<a name="1.20.1-1.6.12"></a>
5-
## [1.20.1-1.6.12](/compare/1.20.1-1.6.11...1.20.1-1.6.12) - 2025-11-11 15:05:04
15+
## [1.20.1-1.6.12](/compare/1.20.1-1.6.11...1.20.1-1.6.12) - 2025-11-11 15:05:04 +0100
616

717

818
### Fixed

CHANGELOG-1.21.1.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# Changelog for Minecraft 1.21.1
22
All notable changes to this project will be documented in this file.
33

4+
<a name="1.21.1-1.6.20"></a>
5+
## [1.21.1-1.6.20](https://github.com/CyclopsMC/IntegratedTerminals/compare/1.21.1-1.6.19...1.21.1-1.6.20) - 2025-11-16 15:33:59
6+
7+
8+
### Fixed
9+
* Fix serialize threads not closing after terminal is closed
10+
This makes sure that thread pools are localized per container, and
11+
is closed once the container is closed.
12+
Closes #185
13+
414
<a name="1.21.1-1.6.19"></a>
5-
## [1.21.1-1.6.19](https://github.com/CyclopsMC/IntegratedTerminals/compare/1.21.1-1.6.18...1.21.1-1.6.19) - 2025-11-15 06:06:13
15+
## [1.21.1-1.6.19](https://github.com/CyclopsMC/IntegratedTerminals/compare/1.21.1-1.6.18...1.21.1-1.6.19) - 2025-11-15 06:06:13 +0100
616

717

818
### Fixed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
As always, don't forget to backup your world before updating!
2+
Requires CyclopsCore version 1.19.4 or higher.
3+
4+
Fixes:
5+
* Fix serialize threads not closing after terminal is closed
6+
This makes sure that thread pools are localized per container, and
7+
is closed once the container is closed.
8+
Closes #185
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
As always, don't forget to backup your world before updating!
2+
Requires CyclopsCore version 1.19.4 or higher.
3+
4+
Fixes:
5+
* Fix serialize threads not closing after terminal is closed
6+
This makes sure that thread pools are localized per container, and
7+
is closed once the container is closed.
8+
Closes #185
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
As always, don't forget to backup your world before updating!
2+
Requires CyclopsCore version 1.25.1 or higher.
3+
4+
Fixes:
5+
* Fix serialize threads not closing after terminal is closed
6+
This makes sure that thread pools are localized per container, and
7+
is closed once the container is closed.
8+
Closes #185

src/main/java/org/cyclops/integratedterminals/IntegratedTerminals.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import net.neoforged.bus.api.IEventBus;
66
import net.neoforged.fml.common.Mod;
77
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
8-
import net.neoforged.neoforge.event.server.ServerStartingEvent;
9-
import net.neoforged.neoforge.event.server.ServerStoppingEvent;
108
import net.neoforged.neoforge.registries.NewRegistryEvent;
119
import org.apache.logging.log4j.Level;
1210
import org.cyclops.cyclopscore.config.ConfigHandlerCommon;
@@ -26,7 +24,6 @@
2624
import org.cyclops.integratedterminals.capability.ingredient.TerminalIngredientComponentCapabilities;
2725
import org.cyclops.integratedterminals.component.DataComponentTerminalStorageInventoriesConfig;
2826
import org.cyclops.integratedterminals.component.DataComponentTerminalStorageStateConfig;
29-
import org.cyclops.integratedterminals.core.terminalstorage.TerminalStorageTabIngredientComponentServer;
3027
import org.cyclops.integratedterminals.core.terminalstorage.TerminalStorageTabRegistry;
3128
import org.cyclops.integratedterminals.core.terminalstorage.TerminalStorageTabs;
3229
import org.cyclops.integratedterminals.core.terminalstorage.crafting.TerminalStorageTabIngredientCraftingHandlerRegistry;
@@ -40,9 +37,6 @@
4037
import org.cyclops.integratedterminals.proxy.ClientProxy;
4138
import org.cyclops.integratedterminals.proxy.CommonProxy;
4239

43-
import java.util.concurrent.Executors;
44-
import java.util.concurrent.TimeUnit;
45-
4640
/**
4741
* The main mod class of this mod.
4842
* @author rubensworks (aka kroeserr)
@@ -138,23 +132,6 @@ protected ICommonProxy constructCommonProxy() {
138132
return new CommonProxy();
139133
}
140134

141-
public void onServerStarting(ServerStartingEvent event) {
142-
TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER = Executors.newFixedThreadPool(1);
143-
}
144-
145-
public void onServerStopping(ServerStoppingEvent event) {
146-
TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER.shutdown();
147-
try {
148-
if (!TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER.awaitTermination(5, TimeUnit.SECONDS)) {
149-
TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER.shutdownNow();
150-
}
151-
} catch (InterruptedException ex) {
152-
TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER.shutdownNow();
153-
Thread.currentThread().interrupt();
154-
}
155-
TerminalStorageTabIngredientComponentServer.PACKET_SERIALIZER = null;
156-
}
157-
158135
/**
159136
* Log a new info message for this mod.
160137
* @param message The message to show.

src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabIngredientComponentServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
public class TerminalStorageTabIngredientComponentServer<T, M> implements ITerminalStorageTabServer,
6868
IIngredientComponentStorageObservable.IIndexChangeObserver<T, M> {
6969

70-
public static ExecutorService PACKET_SERIALIZER = Executors.newFixedThreadPool(1);
71-
70+
private final ExecutorService packetSerializer = Executors.newFixedThreadPool(1);
7271
private final ResourceLocation name;
7372
private final INetwork network;
7473
private final IngredientComponent<T, M> ingredientComponent;
@@ -165,6 +164,7 @@ protected void initChannel(int channel) {
165164

166165
@Override
167166
public void deInit() {
167+
this.packetSerializer.shutdownNow();
168168
this.ingredientNetwork.removeObserver(this);
169169
}
170170

@@ -367,7 +367,7 @@ protected void sendToClient(IIngredientComponentStorageObservable.StorageChangeE
367367

368368
for (IngredientArrayList<T, M> chunk : chunks) {
369369
if (GeneralConfig.packetSerializationEnableMultithreading) {
370-
PACKET_SERIALIZER.execute(() -> sendToClient(new IIngredientComponentStorageObservable.StorageChangeEvent<>(
370+
packetSerializer.execute(() -> sendToClient(new IIngredientComponentStorageObservable.StorageChangeEvent<>(
371371
event.getChannel(), event.getPos(), event.getChangeType(), event.isCompleteChange(), chunk, false
372372
)));
373373
} else {
@@ -407,7 +407,7 @@ private void sendCraftingOptionsToClient(int channel, Collection<HandlerWrappedT
407407

408408
for (Pair<Boolean, List<HandlerWrappedTerminalCraftingOption<T>>> chunk : chunks) {
409409
if (GeneralConfig.packetSerializationEnableMultithreading) {
410-
PACKET_SERIALIZER.execute(() -> sendCraftingOptionsToClient(channel, chunk.getRight(), chunk.getLeft(), firstChannel));
410+
packetSerializer.execute(() -> sendCraftingOptionsToClient(channel, chunk.getRight(), chunk.getLeft(), firstChannel));
411411
} else {
412412
sendCraftingOptionsToClient(channel, chunk.getRight(), chunk.getLeft(), firstChannel);
413413
}

0 commit comments

Comments
 (0)