mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Fixed enderman and other entity forcefield false-positives
This commit is contained in:
1 parent
246af0b3aa
commit
989540d73b
2 files changed
+8
-7
No files matched your search
@@ -61,7 +61,7 @@ public class PlayerListener extends EventListener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerToggleFlight(PlayerToggleFlightEvent event)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class PlayerListener extends EventListener
|
||||
backend.logEnterExit(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class PlayerListener extends EventListener
|
||||
{
|
||||
backend.logEnterExit(event.getPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event)
|
||||
@@ -380,14 +380,14 @@ public class PlayerListener extends EventListener
|
||||
event.setTo(from);
|
||||
}
|
||||
log("tried to move too fast.", player, CheckType.SPEED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.WATER_WALK) && backend.checkWaterWalk(player, x, z))
|
||||
{
|
||||
if (!config.silentMode())
|
||||
{
|
||||
event.setTo(from);
|
||||
player.teleport(player.getLocation().add(0, -1, 0));
|
||||
}
|
||||
log("tried to walk on water.", player, CheckType.WATER_WALK);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -542,7 +543,7 @@ public class Backend
|
||||
public boolean checkSight(Player player, Entity entity)
|
||||
{
|
||||
// Check to make sure the entity's head is not surrounded
|
||||
Block head = entity.getLocation().add(0, 1, 0).getBlock();
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user