Catch instance where enderman's head is in a block, also handle having no ban broadcast string gracefully

This commit is contained in:
h31ix committed 2012-10-07 10:50:08 -04:00
1 parent 308062aebb
commit 8f47edd61e
3 files changed
+39 -24

No files matched your search

@@ -545,9 +545,16 @@ public class Backend
// Check to make sure the entity's head is not surrounded
Block head = entity.getWorld().getBlockAt((int)entity.getLocation().getX(), (int)((CraftEntity)entity).getHandle().getHeadHeight(), (int)entity.getLocation().getZ());
boolean solid = false;
if(head.getRelative(BlockFace.NORTH).getTypeId() != 0)
if(head.getTypeId() != 0)
{
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.NORTH).getTypeId()].material.isSolid();
solid = net.minecraft.server.Block.byId[head.getTypeId()].material.isSolid();
}
if(!solid)
{
if(head.getRelative(BlockFace.NORTH).getTypeId() != 0)
{
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.NORTH).getTypeId()].material.isSolid();
}
}
if(!solid)
{