From b2d44dfbbb714fcb30a526a20405e9436855a233 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:07:50 +0200 Subject: Do not unload in SSP --- .../technus/tectech/mechanics/data/ChunkDataHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java index f6d84d6b12..8109db9b86 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java @@ -5,6 +5,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.event.world.ChunkDataEvent; @@ -102,10 +103,12 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) @SubscribeEvent public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()) - .get(aEvent.world.provider.dimensionId) - .remove(aEvent.getChunk().getChunkCoordIntPair())); + if(aEvent.world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) { + pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()) + .get(aEvent.world.provider.dimensionId) + .remove(aEvent.getChunk().getChunkCoordIntPair())); + } } @SideOnly(Side.CLIENT) -- cgit