From 18868398b41ddeb55365a05ca2d1630223e6d044 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 19 Aug 2013 02:57:57 +0100 Subject: [PATCH] Stop Object3D.getTileEntity() from loading unloaded chunks. --- common/mekanism/api/Object3D.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/mekanism/api/Object3D.java b/common/mekanism/api/Object3D.java index 947c52e6c..e33848529 100644 --- a/common/mekanism/api/Object3D.java +++ b/common/mekanism/api/Object3D.java @@ -4,6 +4,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; public class Object3D @@ -44,6 +45,8 @@ public class Object3D public TileEntity getTileEntity(IBlockAccess world) { + if(!(world instanceof World && ((World)world).blockExists(xCoord, yCoord, yCoord))) + return null; return world.getBlockTileEntity(xCoord, yCoord, zCoord); }