mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
Added NoSlowdown, migrations to new config
This commit is contained in:
1 parent
add3fe5eae
commit
2086a01f80
20 files changed
+288
-243
No files matched your search
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* AntiCheatReloaded for Bukkit and Spigot.
|
||||
* Copyright (c) 2012-2015 AntiCheat Team
|
||||
* Copyright (c) 2016-2020 Rammelkast
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rammelkast.anticheatreloaded.check.movement;
|
||||
|
||||
public class NoSlowdownCheck {
|
||||
|
||||
}
|
||||
@@ -105,10 +105,14 @@ public class SpeedCheck {
|
||||
// Players can move faster in air with slow falling
|
||||
if (VersionUtil.isSlowFalling(player))
|
||||
predict *= 1.25D;
|
||||
// Prevent NoSlow
|
||||
// TODO better way for this
|
||||
if (player.isBlocking() && movementManager.airTicks > 2)
|
||||
predict *= 0.8D;
|
||||
|
||||
if (distanceXZ - predict > limit) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"moved too fast in air (speed=" + distanceXZ + ", limit=" + predict + ")");
|
||||
"moved too fast in air (speed=" + distanceXZ + ", limit=" + predict + ", blocking=" + player.isBlocking() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,14 +179,19 @@ public class SpeedCheck {
|
||||
limit *= 1.25D;
|
||||
}
|
||||
}
|
||||
// Increased speed when stepping on/off half blocks
|
||||
if (Utilities.isNearBed(movingTowards) || Utilities.couldBeOnHalfblock(movingTowards)
|
||||
|| Utilities.isNearBed(movingTowards.clone().add(0, -0.5, 0)))
|
||||
limit *= 2.0D;
|
||||
// Increased speed when stepping on/off boat
|
||||
if (Utilities.couldBeOnBoat(player))
|
||||
limit += 0.2D;
|
||||
// Prevent NoSlow
|
||||
if (player.isBlocking() && movementManager.groundTicks > 2)
|
||||
limit *= 0.45D;
|
||||
if (distanceXZ - limit > 0) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"moved too fast on ground (speed=" + distanceXZ + ", limit=" + limit + ")");
|
||||
"moved too fast on ground (speed=" + distanceXZ + ", limit=" + limit + ", blocking=" + player.isBlocking() + ")");
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
|
||||
Reference in new issue
Block a user