From db135274989f2e79385e970ac819ca556653f815 Mon Sep 17 00:00:00 2001 From: Rammelkast Date: Tue, 3 Jan 2017 16:14:29 +0100 Subject: [PATCH] Fix #26 --- pom.xml | 16 ++++++---------- .../anticheat/util/NMS_1_9_PLUS.java | 15 +++++++++++++++ .../anticheat/util/VersionUtil.java | 8 +------- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 src/main/java/net/gravitydevelopment/anticheat/util/NMS_1_9_PLUS.java diff --git a/pom.xml b/pom.xml index 91d2b43..c0de749 100644 --- a/pom.xml +++ b/pom.xml @@ -11,13 +11,9 @@ UTF-8 - - dmulloy2-repo - http://repo.dmulloy2.net/content/groups/public/ - - spigot-repo - http://maven.elmakers.com/repository/ + dmulloy2-repo + http://repo.dmulloy2.net/content/groups/public/ @@ -28,8 +24,8 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 + 1.7 + 1.7 @@ -85,7 +81,7 @@ com.comphenix.protocol ProtocolLib - 4.1.0-SNAPSHOT + 4.2.1-SNAPSHOT junit @@ -97,7 +93,7 @@ org.bukkit craftbukkit - 1.11-R0.1-SNAPSHOT + 1.11.2-R0.1-SNAPSHOT provided diff --git a/src/main/java/net/gravitydevelopment/anticheat/util/NMS_1_9_PLUS.java b/src/main/java/net/gravitydevelopment/anticheat/util/NMS_1_9_PLUS.java new file mode 100644 index 0000000..d1a09a4 --- /dev/null +++ b/src/main/java/net/gravitydevelopment/anticheat/util/NMS_1_9_PLUS.java @@ -0,0 +1,15 @@ +package net.gravitydevelopment.anticheat.util; + +import java.util.EnumSet; + +import org.bukkit.Material; + +public class NMS_1_9_PLUS { + + static final EnumSet MOVE_UP_BLOCKS_1_9 = EnumSet.of(Material.ACACIA_STAIRS, + Material.BIRCH_WOOD_STAIRS, Material.BRICK_STAIRS, Material.COBBLESTONE_STAIRS, Material.DARK_OAK_STAIRS, + Material.JUNGLE_WOOD_STAIRS, Material.NETHER_BRICK_STAIRS, Material.QUARTZ_STAIRS, + Material.RED_SANDSTONE_STAIRS, Material.SANDSTONE_STAIRS, Material.SMOOTH_STAIRS, + Material.SPRUCE_WOOD_STAIRS, Material.WOOD_STAIRS, Material.PURPUR_STAIRS); + +} diff --git a/src/main/java/net/gravitydevelopment/anticheat/util/VersionUtil.java b/src/main/java/net/gravitydevelopment/anticheat/util/VersionUtil.java index 89714b1..9d0187a 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/util/VersionUtil.java +++ b/src/main/java/net/gravitydevelopment/anticheat/util/VersionUtil.java @@ -19,12 +19,6 @@ public class VersionUtil { Material.RED_SANDSTONE_STAIRS, Material.SANDSTONE_STAIRS, Material.SMOOTH_STAIRS, Material.SPRUCE_WOOD_STAIRS, Material.WOOD_STAIRS); - private static final EnumSet MOVE_UP_BLOCKS_1_9 = EnumSet.of(Material.ACACIA_STAIRS, - Material.BIRCH_WOOD_STAIRS, Material.BRICK_STAIRS, Material.COBBLESTONE_STAIRS, Material.DARK_OAK_STAIRS, - Material.JUNGLE_WOOD_STAIRS, Material.NETHER_BRICK_STAIRS, Material.QUARTZ_STAIRS, - Material.RED_SANDSTONE_STAIRS, Material.SANDSTONE_STAIRS, Material.SMOOTH_STAIRS, - Material.SPRUCE_WOOD_STAIRS, Material.WOOD_STAIRS, Material.PURPUR_STAIRS); - public static boolean isFlying(Player p) { if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) { return p.isFlying() || p.isGliding() || p.hasPotionEffect(PotionEffectType.LEVITATION); @@ -35,7 +29,7 @@ public class VersionUtil { public static EnumSet getMoveUpBlocks() { if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) { - return MOVE_UP_BLOCKS_1_9; + return NMS_1_9_PLUS.MOVE_UP_BLOCKS_1_9; } else { return MOVE_UP_BLOCKS_1_8; }