mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Catch instance where enderman's head is in a block, also handle having no ban broadcast string gracefully
This commit is contained in:
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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user