diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java | 11 |
1 files changed, 7 insertions, 4 deletions
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) |