diff --git a/src/main/java/com/rammelkast/anticheatreloaded/AntiCheatReloaded.java b/src/main/java/com/rammelkast/anticheatreloaded/AntiCheatReloaded.java index d2b6181..f346e3a 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/AntiCheatReloaded.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/AntiCheatReloaded.java @@ -78,8 +78,9 @@ public class AntiCheatReloaded extends JavaPlugin { eventList.add(new VehicleListener()); eventList.add(new InventoryListener()); // Handles 1.9+ potion effects - if (!VersionUtil.isBountifulUpdate()) + if (!VersionUtil.isBountifulUpdate()) { eventList.add(new PotionEffectListener()); + } // Order is important in some cases, don't screw with these unless // needed, especially config this.setupConfig(); diff --git a/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java b/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java index 87d1896..9b323c2 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java @@ -187,8 +187,10 @@ public final class Utilities { } public static boolean isNearShulkerBox(Location location) { - if (VersionUtil.isBountifulUpdate()) + // Shulkers are 1.12+ + if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.COLOR_UPDATE)) { return false; + } return isShulkerBox(location.getBlock()) || isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH)) || isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH)) || isShulkerBox(location.getBlock().getRelative(BlockFace.EAST)) @@ -224,7 +226,8 @@ public final class Utilities { } public static boolean isHalfblock(Block block) { - if (!VersionUtil.isBountifulUpdate()) { + // getBoundingBox() is only available on 1.14+ + if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) { BoundingBox box = block.getBoundingBox(); double height = box.getMaxY() - box.getMinY(); if (height > 0.42 && height <= 0.6 && block.getType().isSolid()) @@ -458,7 +461,7 @@ public final class Utilities { return player.getLocation().getBlock().isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid() - || (!VersionUtil.isBountifulUpdate() + || (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.AQUATIC_UPDATE) && (player.getLocation().getBlock().getType() == XMaterial.KELP_PLANT.parseMaterial() || player.getLocation().getBlock().getRelative(BlockFace.UP) .getType() == XMaterial.KELP_PLANT.parseMaterial() diff --git a/src/main/java/com/rammelkast/anticheatreloaded/util/VersionUtil.java b/src/main/java/com/rammelkast/anticheatreloaded/util/VersionUtil.java index 8d591f3..b610097 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/util/VersionUtil.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/util/VersionUtil.java @@ -36,7 +36,7 @@ import com.rammelkast.anticheatreloaded.AntiCheatReloaded; public class VersionUtil { private static final List SUPPORTED_VERSIONS = Arrays - .asList(new String[] { "v1_16", "v1_15", "v1_14", "v1_13", "v1_8_R3" }); + .asList(new String[] { "v1_16", "v1_15", "v1_14", "v1_13", "v1_12", "v1_8_R3" }); public static String getVersion() { return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];