mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 06:28:52 +00:00
Really fix #122. This was due to a complete misunderstanding of what the user was really saying.
This commit is contained in:
1 parent
600fee0036
commit
46aeb9971e
1 file changed
+14
-10
@@ -403,12 +403,14 @@ public class Backend {
|
||||
} else {
|
||||
if (y1 > lastYcoord.get(name) && yAxisViolations.get(name) > magic.Y_MAXVIOLATIONS && (System.currentTimeMillis() - yAxisLastViolation.get(name)) < magic.Y_MAXVIOTIME) {
|
||||
Location g = player.getLocation();
|
||||
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.");
|
||||
yAxisViolations.put(name, yAxisViolations.get(name) + 1);
|
||||
yAxisLastViolation.put(name, System.currentTimeMillis());
|
||||
if (g.getBlock().getTypeId() == 0) {
|
||||
player.teleport(g);
|
||||
if (!micromanage.getConfiguration().silentMode()) {
|
||||
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.");
|
||||
if (g.getBlock().getTypeId() == 0) {
|
||||
player.teleport(g);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -419,11 +421,13 @@ public class Backend {
|
||||
}
|
||||
if ((y1 - lastYcoord.get(name)) > magic.Y_MAXDIFF && (System.currentTimeMillis() - lastYtime.get(name)) < magic.Y_TIME) {
|
||||
Location g = player.getLocation();
|
||||
g.setY(lastYcoord.get(name));
|
||||
yAxisViolations.put(name, yAxisViolations.get(name) + 1);
|
||||
yAxisLastViolation.put(name, System.currentTimeMillis());
|
||||
if (g.getBlock().getTypeId() == 0) {
|
||||
player.teleport(g);
|
||||
if (!micromanage.getConfiguration().silentMode()) {
|
||||
g.setY(lastYcoord.get(name));
|
||||
if (g.getBlock().getTypeId() == 0) {
|
||||
player.teleport(g);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -596,7 +600,7 @@ public class Backend {
|
||||
Long math = System.currentTimeMillis() - lastBlockBroken.get(name);
|
||||
if (fastBreakViolation.get(name) > violations && math < magic.FASTBREAK_MAXVIOLATIONTIME) {
|
||||
lastBlockBroken.put(name, System.currentTimeMillis());
|
||||
player.sendMessage(ChatColor.RED + "[AntiCheat] Fastbreaking detected. Please wait 10 seconds before breaking blocks.");
|
||||
if (!micromanage.getConfiguration().silentMode()) player.sendMessage(ChatColor.RED + "[AntiCheat] Fastbreaking detected. Please wait 10 seconds before breaking blocks.");
|
||||
return true;
|
||||
} else if (fastBreakViolation.get(name) > 0 && math > magic.FASTBREAK_MAXVIOLATIONTIME) {
|
||||
fastBreakViolation.put(name, 0);
|
||||
@@ -648,7 +652,7 @@ public class Backend {
|
||||
long time = System.currentTimeMillis();
|
||||
String name = player.getName();
|
||||
if (!lastBlockPlaceTime.containsKey(name) || !fastPlaceViolation.containsKey(name)) {
|
||||
lastBlockPlaceTime.put(name, Long.parseLong("0"));
|
||||
lastBlockPlaceTime.put(name, 0L);
|
||||
if (!fastPlaceViolation.containsKey(name)) {
|
||||
fastPlaceViolation.put(name, 0);
|
||||
}
|
||||
@@ -656,7 +660,7 @@ public class Backend {
|
||||
Long math = System.currentTimeMillis() - lastBlockPlaced.get(name);
|
||||
if (lastBlockPlaced.get(name) > 0 && math < magic.FASTPLACE_MAXVIOLATIONTIME) {
|
||||
lastBlockPlaced.put(name, time);
|
||||
player.sendMessage(ChatColor.RED + "[AntiCheat] Fastplacing detected. Please wait 10 seconds before placing blocks.");
|
||||
if (!micromanage.getConfiguration().silentMode()) player.sendMessage(ChatColor.RED + "[AntiCheat] Fastplacing detected. Please wait 10 seconds before placing blocks.");
|
||||
return true;
|
||||
} else if (lastBlockPlaced.get(name) > 0 && math > magic.FASTPLACE_MAXVIOLATIONTIME) {
|
||||
fastPlaceViolation.put(name, 0);
|
||||
|
||||
Reference in new issue
Block a user