Stop Object3D.getTileEntity() from loading unloaded chunks.
This commit is contained in:
parent
896daa10e8
commit
18868398b4
1 changed files with 3 additions and 0 deletions
|
@ -4,6 +4,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
|
||||||
public class Object3D
|
public class Object3D
|
||||||
|
@ -44,6 +45,8 @@ public class Object3D
|
||||||
|
|
||||||
public TileEntity getTileEntity(IBlockAccess world)
|
public TileEntity getTileEntity(IBlockAccess world)
|
||||||
{
|
{
|
||||||
|
if(!(world instanceof World && ((World)world).blockExists(xCoord, yCoord, yCoord)))
|
||||||
|
return null;
|
||||||
return world.getBlockTileEntity(xCoord, yCoord, zCoord);
|
return world.getBlockTileEntity(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue