Permalink
Browse files

Fixed a crash with skulls

  • Loading branch information...
Ri5ux committed Sep 25, 2018
1 parent da0101a commit 91a5d9fa4f5e3be5da3c43fc80d2232ae5136c61
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/main/java/org/avp/tile/TileEntitySkull.java
@@ -4,6 +4,7 @@
import com.arisux.mdx.lib.world.tile.IRotatableYAxis;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
@@ -13,10 +14,17 @@
public class TileEntitySkull extends TileEntity implements IRotatableYAxis
{
private EnumFacing direction;
public BlockSkull getSkullBlock()
{
return (BlockSkull) this.world.getBlockState(this.getPos()).getBlock();
Block block = this.world.getBlockState(this.getPos()).getBlock();
if (block instanceof BlockSkull)
{
return (BlockSkull) block;
}
return null;
}
@Override
@@ -46,7 +54,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
nbt.setInteger("Direction", this.direction.ordinal());
}
return nbt;
}

0 comments on commit 91a5d9f

Please sign in to comment.