mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Compiles with 1.3.1 - fixed flying and random teleportation issues, continuing to bugfix.
This commit is contained in:
1 parent
30ac883120
commit
67d9645e42
3 files changed
+29
-41
No files matched your search
@@ -42,7 +42,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.2.5-R4.0</version>
|
<version>1.3.1-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -60,6 +60,15 @@ public class PlayerListener extends EventListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerToggleFlight(PlayerToggleFlightEvent event)
|
||||||
|
{
|
||||||
|
if(!event.isFlying())
|
||||||
|
{
|
||||||
|
backend.logEnterExit(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onProjectileLaunch(ProjectileLaunchEvent event)
|
public void onProjectileLaunch(ProjectileLaunchEvent event)
|
||||||
{
|
{
|
||||||
@@ -300,6 +309,7 @@ public class PlayerListener extends EventListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("tried to fly.", player, CheckType.FLY);
|
log("tried to fly.", player, CheckType.FLY);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && (backend.checkYAxis(player, distance) || backend.checkAscension(player, from.getY(), to.getY())))
|
if (checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && (backend.checkYAxis(player, distance) || backend.checkAscension(player, from.getY(), to.getY())))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class Backend
|
|||||||
private static final int CHAT_KICK_LEVEL = 10;
|
private static final int CHAT_KICK_LEVEL = 10;
|
||||||
private static final int CHAT_BAN_LEVEL = 3;
|
private static final int CHAT_BAN_LEVEL = 3;
|
||||||
|
|
||||||
private static final int FLIGHT_LIMIT = 4;
|
private static final int FLIGHT_LIMIT = 7;
|
||||||
private static final int Y_MAXVIOLATIONS = 1;
|
private static final int Y_MAXVIOLATIONS = 1;
|
||||||
private static final int Y_MAXVIOTIME = 5000;
|
private static final int Y_MAXVIOTIME = 5000;
|
||||||
private static final int VELOCITY_TIME = 60;
|
private static final int VELOCITY_TIME = 60;
|
||||||
@@ -114,8 +114,6 @@ public class Backend
|
|||||||
private static final double XZ_SPEED_MAX_WATER = 0.19;
|
private static final double XZ_SPEED_MAX_WATER = 0.19;
|
||||||
private static final double XZ_SPEED_MAX_WATER_SPRINT = 0.3;
|
private static final double XZ_SPEED_MAX_WATER_SPRINT = 0.3;
|
||||||
|
|
||||||
private static final int FLY_LOOP = 5;
|
|
||||||
|
|
||||||
private AnticheatManager micromanage = null;
|
private AnticheatManager micromanage = null;
|
||||||
private List<String> droppedItem = new ArrayList<String>();
|
private List<String> droppedItem = new ArrayList<String>();
|
||||||
private List<String> movingExempt = new ArrayList<String>();
|
private List<String> movingExempt = new ArrayList<String>();
|
||||||
@@ -610,47 +608,27 @@ public class Backend
|
|||||||
//This was a teleport, so we don't care about it.
|
//This was a teleport, so we don't care about it.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
double y1 = distance.fromY();
|
String name = player.getName();
|
||||||
double y2 = distance.toY();
|
int y1 = (int)distance.fromY();
|
||||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
int y2 = (int)distance.toY();
|
||||||
if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player) && !Utilities.isOnVine(player))
|
if((y1 == y2 || y1 < y2) && Utilities.cantStandAt(player.getLocation().add(0, -1, 0).getBlock()) && Utilities.cantStandAt(player.getLocation().add(0, -2, 0).getBlock()))
|
||||||
{
|
{
|
||||||
String name = player.getName();
|
int violation = flightViolation.containsKey(name) ? flightViolation.get(name) + 1 : 1;
|
||||||
if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock()) && !Utilities.isInWater(player))
|
increment(player, flightViolation, violation);
|
||||||
|
if(violation > FLIGHT_LIMIT)
|
||||||
{
|
{
|
||||||
int violation = 1;
|
return true;
|
||||||
if (!flightViolation.containsKey(name))
|
}
|
||||||
{
|
else
|
||||||
flightViolation.put(name, violation);
|
{
|
||||||
}
|
return false;
|
||||||
else
|
|
||||||
{
|
|
||||||
violation = flightViolation.get(name) + 1;
|
|
||||||
flightViolation.put(name, violation);
|
|
||||||
}
|
|
||||||
if (violation >= FLIGHT_LIMIT)
|
|
||||||
{
|
|
||||||
flightViolation.put(name, 1);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//Start Fly bypass patch.
|
|
||||||
if (flightViolation.containsKey(name) && flightViolation.get(name) > 0)
|
|
||||||
{
|
|
||||||
for (int i = FLY_LOOP; i > 0; i--)
|
|
||||||
{
|
|
||||||
Location newLocation = new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY() - i, player.getLocation().getZ());
|
|
||||||
Block lower = newLocation.getBlock();
|
|
||||||
if (lower.getTypeId() == 0)
|
|
||||||
{
|
|
||||||
player.teleport(newLocation);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//End Fly bypass patch.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
else
|
||||||
|
{
|
||||||
|
flightViolation.put(name, 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logAscension(Player player, double y1, double y2)
|
public void logAscension(Player player, double y1, double y2)
|
||||||
|
|||||||
Reference in new issue
Block a user