mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 15:57:42 +00:00
Fix ConcurrentModificationException in tile chunk load hook
This commit is contained in:
1 parent
29e4eda53b
commit
ccc986f1d7
1 file changed
+5
-1
@@ -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<TileEntity>)event.getChunk().chunkTileEntityMap.values()))
|
||||
List<TileEntity> list = new ArrayList<TileEntity>(event.getChunk().chunkTileEntityMap.values());
|
||||
for(TileEntity t : list)
|
||||
if(t instanceof IChunkLoadTile)
|
||||
((IChunkLoadTile)t).onChunkLoad();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user