mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
avoid casting the TileEntity Map to HashMap, in case another mod replaces it. Fixes #4934
This commit is contained in:
1 parent
424e84a9a2
commit
58f5a27eee
1 file changed
+5
-9
@@ -112,6 +112,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeProvider;
|
||||
@@ -949,18 +950,13 @@ public class Mekanism
|
||||
{
|
||||
if(event.getChunk() != null && !event.getWorld().isRemote)
|
||||
{
|
||||
Map copy = (Map)((HashMap)event.getChunk().getTileEntityMap()).clone();
|
||||
Map<BlockPos, TileEntity> copy = new HashMap<>(event.getChunk().getTileEntityMap());
|
||||
|
||||
for (Object obj : copy.values())
|
||||
for (TileEntity tileEntity : copy.values())
|
||||
{
|
||||
if (obj instanceof TileEntity)
|
||||
if (tileEntity instanceof IChunkLoadHandler)
|
||||
{
|
||||
TileEntity tileEntity = (TileEntity) obj;
|
||||
|
||||
if (tileEntity instanceof IChunkLoadHandler)
|
||||
{
|
||||
((IChunkLoadHandler) tileEntity).onChunkLoad();
|
||||
}
|
||||
((IChunkLoadHandler) tileEntity).onChunkLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user