MAC will no longer false positive on people standing blocks from block morph.
This commit is contained in:
parent
cd4d2c16a8
commit
6ded835ba4
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user