mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Another fix for enderman/other entities in forcefield check
This commit is contained in:
1 parent
848ffc3b3c
commit
9714cfd767
2 files changed
+16
-30
No files matched your search
@@ -543,38 +543,24 @@ public class Backend
|
|||||||
public boolean checkSight(Player player, Entity entity)
|
public boolean checkSight(Player player, Entity entity)
|
||||||
{
|
{
|
||||||
// Check to make sure the entity's head is not surrounded
|
// 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());
|
Block head = entity.getWorld().getBlockAt((int)entity.getLocation().getX(), (int)(entity.getLocation().getY()+((CraftEntity)entity).getHandle().getHeadHeight()), (int)entity.getLocation().getZ());
|
||||||
boolean solid = false;
|
boolean solid = false;
|
||||||
if(head.getTypeId() != 0)
|
//TODO: This sucks. See if it's possible to not have as many false-positives while still retaining most of the check.
|
||||||
|
for(int x=-2;x<=2;x++)
|
||||||
{
|
{
|
||||||
solid = net.minecraft.server.Block.byId[head.getTypeId()].material.isSolid();
|
for(int z=-2;z<=2;z++)
|
||||||
}
|
|
||||||
if(!solid)
|
|
||||||
{
|
|
||||||
if(head.getRelative(BlockFace.NORTH).getTypeId() != 0)
|
|
||||||
{
|
{
|
||||||
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.NORTH).getTypeId()].material.isSolid();
|
for(int y=-1;y<2;y++)
|
||||||
}
|
{
|
||||||
}
|
if(head.getRelative(x, y, z).getTypeId() != 0)
|
||||||
if(!solid)
|
{
|
||||||
{
|
if(net.minecraft.server.Block.byId[head.getRelative(x, y, z).getTypeId()].material.isSolid())
|
||||||
if(head.getRelative(BlockFace.SOUTH).getTypeId() != 0)
|
{
|
||||||
{
|
solid = true;
|
||||||
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.SOUTH).getTypeId()].material.isSolid();
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!solid)
|
}
|
||||||
{
|
|
||||||
if(head.getRelative(BlockFace.EAST).getTypeId() != 0)
|
|
||||||
{
|
|
||||||
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.EAST).getTypeId()].material.isSolid();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!solid)
|
|
||||||
{
|
|
||||||
if(head.getRelative(BlockFace.WEST).getTypeId() != 0)
|
|
||||||
{
|
|
||||||
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.WEST).getTypeId()].material.isSolid();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return solid ? true : player.hasLineOfSight(entity);
|
return solid ? true : player.hasLineOfSight(entity);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ name: AntiCheat
|
|||||||
softdepend: [AntiCheat]
|
softdepend: [AntiCheat]
|
||||||
startup: postworld
|
startup: postworld
|
||||||
url: http://gravitydevelopment.net
|
url: http://gravitydevelopment.net
|
||||||
version: ${project.version}-{build.number}-DEV
|
version: ${project.version}-DEV-b${BUILD_NUMBER}
|
||||||
commands:
|
commands:
|
||||||
anticheat:
|
anticheat:
|
||||||
description: Control and view info about AntiCheat
|
description: Control and view info about AntiCheat
|
||||||
|
|||||||
Reference in new issue
Block a user