diff --git a/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java b/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java index 038bcce26..000e8f1f1 100644 --- a/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java +++ b/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java @@ -10,8 +10,10 @@ import dev.brighten.api.check.CheckType; import lombok.val; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -24,9 +26,17 @@ public class ReachA extends Check { private LivingEntity target; private double buffer; + private static List allowedEntityTypes = Arrays + .asList(EntityType.ZOMBIE, EntityType.SHEEP, EntityType.BLAZE, + EntityType.SKELETON, EntityType.PLAYER, EntityType.VILLAGER, EntityType.IRON_GOLEM, + EntityType.WITCH, EntityType.COW, EntityType.CREEPER); + @Packet public void onFlying(WrappedInUseEntityPacket packet, long timeStamp) { - if(data.playerInfo.creative || data.targetPastLocation.previousLocations.size() < 10) return; + if(data.playerInfo.creative + || data.targetPastLocation.previousLocations.size() < 10 + || target == null + || !allowedEntityTypes.contains(target.getType())) return; List targetBoxes = data.targetPastLocation .getEstimatedLocation(timeStamp, (data.lagInfo.transPing + 3) * 50, 100L) @@ -64,7 +74,6 @@ public void onUse(WrappedInUseEntityPacket packet, long timeStamp) { } private static SimpleCollisionBox getHitbox(Entity entity, KLocation loc) { - CollisionBox box = EntityData.getEntityBox(loc, entity); - return box instanceof SimpleCollisionBox ? (SimpleCollisionBox) box : null; + return (SimpleCollisionBox) EntityData.getEntityBox(loc, entity); } } diff --git a/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/fly/FlyA.java b/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/fly/FlyA.java index 357bf55d3..843e4ab1d 100644 --- a/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/fly/FlyA.java +++ b/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/fly/FlyA.java @@ -12,7 +12,7 @@ import net.minecraft.server.v1_8_R3.BlockClay; @CheckInfo(name = "Fly (A)", description = "Simple fly check.", punishVL = 10, - checkType = CheckType.FLIGHT, vlToFlag = 1, developer = true) + checkType = CheckType.FLIGHT, vlToFlag = 3, developer = true) @Cancellable public class FlyA extends Check { @@ -75,6 +75,7 @@ public void onFlying(WrappedInFlyingPacket packet, long timeStamp) { if(check > 0.016 && data.playerInfo.lastHalfBlock.hasPassed(5) && data.playerInfo.lastVelocity.hasPassed(4)) { vl++; + if(vl > 2) flag("deltaY=%v.4 predicted=%v.4", data.playerInfo.deltaY, predicted); } else if(vl > 0) vl-= 0.1; end = System.nanoTime() - start; diff --git a/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/speed/SpeedA.java b/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/speed/SpeedA.java index 4b1c857a1..689f59774 100644 --- a/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/speed/SpeedA.java +++ b/Free/src/main/java/dev/brighten/anticheat/check/impl/movement/speed/SpeedA.java @@ -21,13 +21,14 @@ public class SpeedA extends Check { private double ldxz = .12f; private float friction = 0.91f; private float buffer; + private double vxz; @Packet public void onVelocity(WrappedOutVelocityPacket packet) { if(packet.getId() == data.getPlayer().getEntityId()) { data.runKeepaliveAction(ka -> { - ldxz = Math.hypot(packet.getX(), packet.getZ()); - debug("set velocity: %v.3", ldxz); + vxz = Math.hypot(packet.getX(), packet.getZ()); + debug("set velocity: %v.3", vxz); }); } } @@ -86,7 +87,10 @@ public void onFlying(WrappedInFlyingPacket packet) { } else if(buffer > 0) buffer-= 0.2f; debug("ratio=%v.1 tags=%v", ratio, tags.build()); - ldxz = data.playerInfo.deltaXZ * drag; + if(vxz != 0) { + ldxz = vxz; + vxz = 0; + } else ldxz = data.playerInfo.deltaXZ * drag; } friction = data.blockInfo.currentFriction; } diff --git a/Impl/src/main/java/dev/brighten/anticheat/Load.java b/Impl/src/main/java/dev/brighten/anticheat/Load.java index 796375b40..3b2102265 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/Load.java +++ b/Impl/src/main/java/dev/brighten/anticheat/Load.java @@ -17,13 +17,12 @@ import dev.brighten.anticheat.processing.keepalive.KeepaliveProcessor; import dev.brighten.anticheat.utils.SystemUtil; import dev.brighten.anticheat.utils.TickTimer; -import dev.brighten.anticheat.utils.file.FileDownloader; +import dev.brighten.anticheat.classloader.file.FileDownloader; import dev.brighten.api.KauriAPI; import org.bukkit.Bukkit; import java.io.File; import java.io.UnsupportedEncodingException; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; diff --git a/Impl/src/main/java/dev/brighten/anticheat/classloader/KauriClassLoader.java b/Impl/src/main/java/dev/brighten/anticheat/classloader/KauriClassLoader.java index 0a0a5ea5b..023874819 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/classloader/KauriClassLoader.java +++ b/Impl/src/main/java/dev/brighten/anticheat/classloader/KauriClassLoader.java @@ -1,14 +1,11 @@ package dev.brighten.anticheat.classloader; import dev.brighten.anticheat.utils.SystemUtil; -import dev.brighten.anticheat.utils.file.JarUtil; -import lombok.Getter; +import dev.brighten.anticheat.classloader.file.JarUtil; import java.io.File; import java.net.URL; import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.List; import java.util.Map; /** diff --git a/Impl/src/main/java/dev/brighten/anticheat/utils/file/FileDownloader.java b/Impl/src/main/java/dev/brighten/anticheat/classloader/file/FileDownloader.java similarity index 97% rename from Impl/src/main/java/dev/brighten/anticheat/utils/file/FileDownloader.java rename to Impl/src/main/java/dev/brighten/anticheat/classloader/file/FileDownloader.java index c2b8f6318..59f9ca1e2 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/utils/file/FileDownloader.java +++ b/Impl/src/main/java/dev/brighten/anticheat/classloader/file/FileDownloader.java @@ -1,4 +1,4 @@ -package dev.brighten.anticheat.utils.file; +package dev.brighten.anticheat.classloader.file; import lombok.Getter; import lombok.Setter; diff --git a/Impl/src/main/java/dev/brighten/anticheat/utils/file/JarUtil.java b/Impl/src/main/java/dev/brighten/anticheat/classloader/file/JarUtil.java similarity index 98% rename from Impl/src/main/java/dev/brighten/anticheat/utils/file/JarUtil.java rename to Impl/src/main/java/dev/brighten/anticheat/classloader/file/JarUtil.java index 5d93a1824..2590e697e 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/utils/file/JarUtil.java +++ b/Impl/src/main/java/dev/brighten/anticheat/classloader/file/JarUtil.java @@ -1,4 +1,4 @@ -package dev.brighten.anticheat.utils.file; +package dev.brighten.anticheat.classloader.file; import java.io.*; import java.util.Enumeration; diff --git a/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java b/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java index 45326c767..84bafd492 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java +++ b/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java @@ -319,8 +319,7 @@ public void process(WrappedInFlyingPacket packet, long timeStamp) { //Running jump check if (!data.playerInfo.clientGround) { if (!data.playerInfo.jumped && data.playerInfo.lClientGround - && data.playerInfo.deltaY >= 0 - && data.playerInfo.deltaY <= data.playerInfo.jumpHeight) { + && data.playerInfo.deltaY >= 0) { data.playerInfo.jumped = true; } else { data.playerInfo.inAir = true; diff --git a/Premium/pom.xml b/Premium/pom.xml index aacaa5f92..9c211b7b2 100644 --- a/Premium/pom.xml +++ b/Premium/pom.xml @@ -59,7 +59,7 @@ dev.brighten.anticheat Impl ${parent.version} - compile + provided diff --git a/Regular/src/main/java/dev/brighten/anticheat/check/RegularChecks.java b/Regular/src/main/java/dev/brighten/anticheat/check/RegularChecks.java index f4ba4047f..244ade8fb 100644 --- a/Regular/src/main/java/dev/brighten/anticheat/check/RegularChecks.java +++ b/Regular/src/main/java/dev/brighten/anticheat/check/RegularChecks.java @@ -58,7 +58,7 @@ public void registerChecks() { Check.register(new KillauraD()); Check.register(new KillauraE()); //Check.register(new KillauraF()); - Check.register(new OmniSprint()); + //Check.register(new OmniSprint()); Check.register(new Timer()); Check.register(new VelocityA()); Check.register(new VelocityC());