mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 06:28:52 +00:00
Added GhostHand and Unicode chat check and fixed broken fly check.
Furthermore: + Updated and documented magic.yml + Added support for missing CAVE_AIR material + Average ping for blink check can now be configured + Removed /acr update from help command + Added UpdateManager.java to be used in future update messages + Better MainHand/OffHand support I've been busy :)
This commit is contained in:
1 parent
acea36929b
commit
fec1286c8d
22 files changed
+596
-193
No files matched your search
@@ -67,11 +67,11 @@ public class GlideCheck {
|
||||
if (VIOLATIONS.get(player.getUniqueId()) + 1 >= AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.GLIDE_LIMIT()) {
|
||||
VIOLATIONS.remove(player.getUniqueId());
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - distanceToFall(to));
|
||||
player.teleport(to);
|
||||
// Report glide violation to statistics, just for the lulz jk
|
||||
AntiCheatReloaded.getPlugin().onGlideViolation();
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - distanceToFall(to));
|
||||
player.teleport(to);
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " was set back for gliding (yDiff="
|
||||
+ new BigDecimal(yDiff).setScale(2, RoundingMode.HALF_UP) + ")");
|
||||
@@ -90,7 +90,8 @@ public class GlideCheck {
|
||||
private static double distanceToFall(Location location) {
|
||||
location = location.clone();
|
||||
double firstY = location.getY();
|
||||
while (location.clone().add(0, -0.1, 0).getBlock().getType() == Material.AIR)
|
||||
Material subtractType = location.clone().add(0, -0.1, 0).getBlock().getType();
|
||||
while (subtractType == Material.AIR || subtractType == Material.CAVE_AIR)
|
||||
location.add(0, -0.1, 0);
|
||||
return firstY - location.getY();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user