MAC will no longer false positive on people standing blocks from block morph.

This commit is contained in:
Chiss 2014-11-07 14:14:43 +11:00
parent cd4d2c16a8
commit 6ded835ba4
2 changed files with 18 additions and 20 deletions

View File

@ -29,6 +29,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
@ -195,11 +196,28 @@ public class AntiHack extends MiniPlugin
public boolean isValid(Player player, boolean groundValid)
{
//Near Other Player
for (Player other : UtilServer.getPlayers())
{
if (player.equals(other))
continue;
if (other.getGameMode() != GameMode.SURVIVAL)
continue;
if (other.getVehicle() != null)
continue;
if (UtilMath.offset(player, other) < 2)
return true;
}
if (player.isFlying() || player.isInsideVehicle() || player.getGameMode() != GameMode.SURVIVAL)
{
return true;
}
//On Ground
if (groundValid)
{
if (UtilEnt.onBlock(player) || player.getLocation().getBlock().getType() != Material.AIR)

View File

@ -1484,24 +1484,4 @@ public class HideSeek extends TeamGame
return ent.getVehicle() != null;
}
@EventHandler
public void UpdateMAC(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetPlayers(true))
for (Player hider : GetPlayers(true))
{
if (player.equals(hider))
continue;
if (!getHiders().HasPlayer(hider))
continue;
if (UtilMath.offset(player, hider) < 2)
AntiHack.Instance.setIgnore(player, 1000);
}
}
}