mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Stop Object3D.getTileEntity() from loading unloaded chunks.
This commit is contained in:
1 parent
896daa10e8
commit
18868398b4
1 file changed
+3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user