diff --git a/src/codechicken/lib/world/TileChunkLoadHook.java b/src/codechicken/lib/world/TileChunkLoadHook.java index 718d45d..e080c2e 100644 --- a/src/codechicken/lib/world/TileChunkLoadHook.java +++ b/src/codechicken/lib/world/TileChunkLoadHook.java @@ -5,6 +5,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.ChunkEvent; +import java.util.ArrayList; +import java.util.List; + public class TileChunkLoadHook { private static boolean init; @@ -17,7 +20,8 @@ public class TileChunkLoadHook @SubscribeEvent public void onChunkLoad(ChunkEvent.Load event) { - for(TileEntity t : ((Iterable)event.getChunk().chunkTileEntityMap.values())) + List list = new ArrayList(event.getChunk().chunkTileEntityMap.values()); + for(TileEntity t : list) if(t instanceof IChunkLoadTile) ((IChunkLoadTile)t).onChunkLoad(); }