Added support for 1.8.8

This commit is contained in:
BuildTools committed 2020-04-19 17:09:30 +02:00
1 parent 661718d001
commit 67e824ef28
14 files changed
+2368 -211

No files matched your search

@@ -29,6 +29,7 @@ import org.bukkit.potion.PotionEffectType;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.util.Distance;
import com.rammelkast.anticheatreloaded.util.VersionUtil;
public class ElytraCheck {
@@ -36,6 +37,11 @@ public class ElytraCheck {
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static CheckResult runCheck(Player player, Distance distance) {
// No elytra in server version
if (VersionUtil.isBountifulUpdate()) {
return PASS;
}
String uuid = player.getUniqueId().toString();
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()) {
// This was a teleport, so skip check.
@@ -55,7 +55,7 @@ public class FlightCheck {
if (!isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1)
&& Utilities.cantStandAtExp(player.getLocation())
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
new Material[] { Material.IRON_BARS })
new Material[] { Utilities.IRON_BARS })
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
new String[] { "FENCE", "FENCE_GATE" })) {
if (!BLOCKS_OVER_FLIGHT.containsKey(uuid)) {
@@ -73,9 +73,7 @@ public class SpeedCheck {
} else if (player.isSprinting()) {
String blockDownName = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().name();
if (blockDownName.endsWith("ICE")
&& ((player.getEyeLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.AIR)
&& (player.getEyeLocation().getBlock().getRelative(BlockFace.UP)
.getType() != Material.CAVE_AIR))) {
&& (player.getEyeLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.AIR)) {
if (player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")) {
reason = "while boosting on " + blockDownName.toLowerCase().replaceAll("_", " ")
+ " and trapdoor";
@@ -25,7 +25,6 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
@@ -69,7 +68,7 @@ public class WaterWalkCheck {
}
if (!violation && !Utilities.isFullyInWater(player.getLocation())
&& Utilities.isHoveringOverWater(player.getLocation(), 1) && y == 0D
&& !block.getType().equals(Material.LILY_PAD)) {
&& !block.getType().equals(Utilities.LILY_PAD)) {
violation = true;
}
if (violation) {
@@ -31,6 +31,7 @@ import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.config.providers.Magic;
import com.rammelkast.anticheatreloaded.util.Utilities;
import com.rammelkast.anticheatreloaded.util.VersionUtil;
import com.rammelkast.anticheatreloaded.util.checkassist.KillauraAssist;
public class IllegalInteract {
@@ -68,7 +69,7 @@ public class IllegalInteract {
player.getGameMode() == GameMode.CREATIVE ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
: player.getLocation().getDirection().getY() > 0.9 ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
: magic.BLOCK_MAX_DISTANCE();
Block targetBlock = player.getTargetBlockExact((int) Math.ceil(distance));
Block targetBlock = VersionUtil.getTargetBlock(player, ((int) Math.ceil(distance)));
if (targetBlock == null) {
// TODO better check here
return true;