mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Clean up deprecated methods
This commit is contained in:
1 parent
3635c840f1
commit
52ed50a89e
2 files changed
+4
-4
No files matched your search
@@ -328,7 +328,7 @@ public class PlayerListener extends EventListener {
|
|||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
int data = result.getData() > 3 ? 3 : result.getData();
|
int data = result.getData() > 3 ? 3 : result.getData();
|
||||||
Location newloc = new Location(player.getWorld(), event.getFrom().getX(), event.getFrom().getY() + data, event.getFrom().getZ());
|
Location newloc = new Location(player.getWorld(), event.getFrom().getX(), event.getFrom().getY() + data, event.getFrom().getZ());
|
||||||
if (newloc.getBlock().getTypeId() == 0) {
|
if (newloc.getBlock().getType() == Material.AIR) {
|
||||||
event.setTo(newloc);
|
event.setTo(newloc);
|
||||||
} else {
|
} else {
|
||||||
event.setTo(user.getGoodLocation(from.clone()));
|
event.setTo(user.getGoodLocation(from.clone()));
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ public class Backend {
|
|||||||
|
|
||||||
for (int i = 0; i < (Math.round(distance.getYDifference())) + 1; i++) {
|
for (int i = 0; i < (Math.round(distance.getYDifference())) + 1; i++) {
|
||||||
Block block = new Location(player.getWorld(), player.getLocation().getX(), to + i, player.getLocation().getZ()).getBlock();
|
Block block = new Location(player.getWorld(), player.getLocation().getX(), to + i, player.getLocation().getZ()).getBlock();
|
||||||
if (block.getTypeId() != 0 && block.getType().isSolid()) {
|
if (block.getType() != Material.AIR && block.getType().isSolid()) {
|
||||||
return new CheckResult(Result.FAILED, player.getName() + " tried to move through a solid block", (int) from + 3);
|
return new CheckResult(Result.FAILED, player.getName() + " tried to move through a solid block", (int) from + 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,7 +457,7 @@ public class Backend {
|
|||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
g.setY(lastYcoord.get(name));
|
g.setY(lastYcoord.get(name));
|
||||||
player.sendMessage(ChatColor.RED + "[AntiCheat] Fly hacking on the y-axis detected. Please wait 5 seconds to prevent getting damage.");
|
player.sendMessage(ChatColor.RED + "[AntiCheat] Fly hacking on the y-axis detected. Please wait 5 seconds to prevent getting damage.");
|
||||||
if (g.getBlock().getTypeId() == 0) {
|
if (g.getBlock().getType() == Material.AIR) {
|
||||||
player.teleport(g);
|
player.teleport(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,7 +476,7 @@ public class Backend {
|
|||||||
yAxisLastViolation.put(name, System.currentTimeMillis());
|
yAxisLastViolation.put(name, System.currentTimeMillis());
|
||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
g.setY(lastYcoord.get(name));
|
g.setY(lastYcoord.get(name));
|
||||||
if (g.getBlock().getTypeId() == 0) {
|
if (g.getBlock().getType() == Material.AIR) {
|
||||||
player.teleport(g);
|
player.teleport(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user