diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index b15997eba..073e0c901 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -26,12 +26,16 @@ configurations["compileOnly"].extendsFrom(localImplementation) configurations["testImplementation"].extendsFrom(localImplementation) +configurations.all { + attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 16) +} + dependencies { "api"(project(":worldedit-core")) "api"(project(":worldedit-libs:bukkit")) // Technically this is api, but everyone should already have some form of the bukkit API // Avoid pulling in another one, especially one so outdated. - "localImplementation"("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") { + "localImplementation"("org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT") { exclude("junit", "junit") } @@ -41,7 +45,7 @@ "localImplementation"("org.apache.logging.log4j:log4j-api") "compileOnly"("org.jetbrains:annotations:20.1.0") - "compileOnly"("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT") { + "compileOnly"("io.papermc.paper:paper-api:1.17-R0.1-SNAPSHOT") { exclude(group = "org.slf4j", module = "slf4j-api") } "implementation"("io.papermc:paperlib:1.0.6") diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index d2562f551..4a0a357a0 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -59,8 +59,6 @@ import org.bukkit.inventory.InventoryHolder; import java.lang.ref.WeakReference; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.nio.file.Path; import java.util.ArrayList; import java.util.EnumMap; @@ -79,8 +77,6 @@ public class BukkitWorld extends AbstractWorld { private static final boolean HAS_3D_BIOMES; private static final boolean HAS_MIN_Y; - private static final Method GET_MIN_Y; - private int minY; private static final Map effects = new HashMap<>(); @@ -99,15 +95,12 @@ public class BukkitWorld extends AbstractWorld { temp = false; } HAS_3D_BIOMES = temp; - Method tempGetMinY; try { - tempGetMinY = World.class.getMethod("getMinHeight"); + World.class.getMethod("getMinHeight"); temp = true; } catch (NoSuchMethodException e) { - tempGetMinY = null; temp = false; } - GET_MIN_Y = tempGetMinY; HAS_MIN_Y = temp; } @@ -127,13 +120,6 @@ public BukkitWorld(World world) { } else { this.worldNativeAccess = null; } - if (HAS_MIN_Y) { - try { - minY = (int) GET_MIN_Y.invoke(world); - } catch (IllegalAccessException | InvocationTargetException e) { - minY = super.getMinY(); - } - } } @Override @@ -374,11 +360,10 @@ public int getMaxY() { @Override public int getMinY() { - /*if (HAS_MIN_Y) { + if (HAS_MIN_Y) { return getWorld().getMinHeight(); } - return super.getMinY();*/ - return minY; + return super.getMinY(); } @SuppressWarnings("deprecation")