mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Fixed #81, removed POS optifine check code that won't work & fixed console messaging
This commit is contained in:
1 parent
8cf2702708
commit
b2701fa057
11 files changed
+33
-76
No files matched your search
@@ -269,18 +269,6 @@ public class Backend {
|
||||
}
|
||||
}
|
||||
|
||||
public CheckResult checkYSpeed(Player player, double y) {
|
||||
if (!isMovingExempt(player) && !player.isInsideVehicle() && !player.isSleeping() && (y > magic.Y_SPEED_MAX())
|
||||
&& !isDoing(player, velocitized, magic.VELOCITY_TIME())
|
||||
&& !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)
|
||||
&& !Utilities.isSlime(player.getLocation().getBlock())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"y speed was too high (speed=" + y + ", max=" + magic.Y_SPEED_MAX() + ")");
|
||||
} else {
|
||||
return PASS;
|
||||
}
|
||||
}
|
||||
|
||||
public CheckResult checkNoFall(Player player, double y) {
|
||||
UUID uuid = player.getUniqueId();
|
||||
if (player.getGameMode() != GameMode.CREATIVE && !player.isInsideVehicle() && !player.isSleeping()
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.util.User;
|
||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
|
||||
public class KillAuraCheck {
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||
|
||||
@@ -114,16 +115,17 @@ public class SpeedCheck {
|
||||
}
|
||||
}
|
||||
|
||||
public CheckResult checkYSpeed(Player player, double y) {
|
||||
public static CheckResult checkYSpeed(Player player, Distance distance) {
|
||||
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
||||
if (!backend.isMovingExempt(player) && !player.isInsideVehicle() && !player.isSleeping()
|
||||
&& (y > backend.getMagic().Y_SPEED_MAX())
|
||||
&& (distance.getYDifference() > backend.getMagic().Y_SPEED_MAX())
|
||||
&& !backend.isDoing(player, backend.velocitized, backend.getMagic().VELOCITY_TIME())
|
||||
&& !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)
|
||||
&& !Utilities.isNearBed(distance.getTo())
|
||||
&& !Utilities.isSlime(AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
||||
.getGoodLocation(player.getLocation()).getBlock())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"y speed was too high (speed=" + y + ", max=" + backend.getMagic().Y_SPEED_MAX() + ")");
|
||||
"y speed was too high (speed=" + distance.getYDifference() + ", max=" + backend.getMagic().Y_SPEED_MAX() + ")");
|
||||
} else {
|
||||
return PASS;
|
||||
}
|
||||
|
||||
@@ -75,8 +75,6 @@ public class BadPacketsCheck {
|
||||
//flag(player, event, "sent the same packet twice");
|
||||
return;
|
||||
}
|
||||
|
||||
user.checkForOptifine(yaw, pitch);
|
||||
}
|
||||
|
||||
private static void flag(Player player, PacketEvent event, String message) {
|
||||
|
||||
Reference in new issue
Block a user