From 4dfb9bea382801e06db300eccfcb4ef1ecddd1ef Mon Sep 17 00:00:00 2001 From: JOO200 Date: Sat, 19 Jun 2021 20:50:25 +0200 Subject: [PATCH] Switch back dependency from Spigot to Paper --- worldguard-bukkit/build.gradle.kts | 3 +-- .../main/java/com/sk89q/worldguard/bukkit/cause/Cause.java | 4 ++-- .../sk89q/worldguard/bukkit/listener/AbstractListener.java | 4 +--- .../bukkit/listener/EventAbstractionListener.java | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/worldguard-bukkit/build.gradle.kts b/worldguard-bukkit/build.gradle.kts index 02c4e123..e3f8749c 100644 --- a/worldguard-bukkit/build.gradle.kts +++ b/worldguard-bukkit/build.gradle.kts @@ -32,8 +32,7 @@ dependencies { "api"(project(":worldguard-core")) - // "compileOnly"("com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT") - /*"runtimeOnly"*/"api"("org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT") { + "api"("io.papermc.paper:paper-aPI:1.17-R0.1-SNAPSHOT") { exclude("junit", "junit") } "api"("com.sk89q.worldedit:worldedit-bukkit:${Versions.WORLDEDIT}") { isTransitive = false } diff --git a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/cause/Cause.java b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/cause/Cause.java index e69e7f16..0c9e5136 100644 --- a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/cause/Cause.java +++ b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/cause/Cause.java @@ -263,13 +263,13 @@ private void addAll(@Nullable Object... element) { ProjectileSource shooter = ((Projectile) o).getShooter(); addAll(shooter); if (shooter == null && o instanceof Firework && PaperLib.isPaper()) { - /* UUID spawningUUID = ((Firework) o).getSpawningEntity(); + UUID spawningUUID = ((Firework) o).getSpawningEntity(); if (spawningUUID != null) { Entity spawningEntity = Bukkit.getEntity(spawningUUID); if (spawningEntity != null) { addAll(spawningEntity); } - }*/ + } } } else if (o instanceof Vehicle) { ((Vehicle) o).getPassengers().forEach(this::addAll); diff --git a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/AbstractListener.java b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/AbstractListener.java index 7d9226b7..8b53db21 100644 --- a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/AbstractListener.java +++ b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/AbstractListener.java @@ -131,12 +131,10 @@ protected RegionAssociable createRegionAssociable(Cause cause) { (BukkitWorldConfiguration) getWorldConfig(BukkitAdapter.adapt(entity.getWorld())); Location loc; if (PaperLib.isPaper() && config.usePaperEntityOrigin) { - /* loc = entity.getOrigin(); if (loc == null) { loc = entity.getLocation(); - }*/ - loc = entity.getLocation(); + } } else { loc = entity.getLocation(); } diff --git a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java index f36e61db..9c3511e2 100644 --- a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java +++ b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java @@ -942,11 +942,11 @@ public void onInventoryOpen(InventoryOpenEvent event) { @EventHandler(ignoreCancelled = true) public void onInventoryMoveItem(InventoryMoveItemEvent event) { InventoryHolder causeHolder; - /* if (HAS_SNAPSHOT_INVHOLDER) { + if (HAS_SNAPSHOT_INVHOLDER) { causeHolder = event.getInitiator().getHolder(false); - } else {*/ + } else { causeHolder = event.getInitiator().getHolder(); - //} + } WorldConfiguration wcfg = null; if (causeHolder instanceof Hopper