diff --git a/build.gradle.kts b/build.gradle.kts index eac46709c..73b883c44 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,7 +33,7 @@ logger.lifecycle(""" ******************************************* """) -var rootVersion by extra("2.5.2") +var rootVersion by extra("2.5.3") var snapshot by extra("SNAPSHOT") var revision: String by extra("") var buildNumber by extra("") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ba983666c..5fe55bb1a 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -31,7 +31,7 @@ dependencies { implementation(gradleApi()) implementation("org.ajoberstar.grgit:grgit-gradle:4.1.1") implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2") - implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.4.1") + implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.1") } kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a442bd1a..83638067a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,10 +10,8 @@ worldguard-bukkit = "7.0.7" mapmanager = "1.8.0-SNAPSHOT" griefprevention = "16.18" griefdefender = "2.1.0-SNAPSHOT" -mcore = "7.0.1" residence = "4.5._13.1" towny = "0.98.4.18" -redprotect = "1.9.6" # Third party bstats = "3.0.0" @@ -25,7 +23,7 @@ auto-value = "1.10.1" findbugs = "3.0.2" rhino-runtime = "1.7.14" zstd-jni = "1.4.8-1" # Not latest as it can be difficult to obtain latest ZSTD libs -antlr4 = "4.11.1" +antlr4 = "4.12.0" json-simple = "1.1.1" jlibnoise = "1.0.0" jchronic = "0.2.4a" @@ -55,10 +53,8 @@ worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", versi mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" } griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" } griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } -mcore = { group = "com.massivecraft", name = "mcore", version.ref = "mcore" } residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" } towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" } -redprotect = { group = "net.fabiozumbi12", name = "redprotect", version.ref = "redprotect" } # Third Party bstatsBase = { group = "org.bstats", name = "bstats-base", version.ref = "bstats" } diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index d3b3c5f22..19e42acb5 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -89,7 +89,6 @@ dependencies { compileOnly(libs.mapmanager) { isTransitive = false } compileOnly(libs.griefprevention) { isTransitive = false } compileOnly(libs.griefdefender) { isTransitive = false } - compileOnly(libs.mcore) { isTransitive = false } compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java index 38764c77c..3c7d96170 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java @@ -1,6 +1,5 @@ package com.fastasyncworldedit.bukkit.listener; -import com.fastasyncworldedit.core.command.tool.MovableTool; import com.fastasyncworldedit.core.command.tool.ResettableTool; import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool; import com.sk89q.worldedit.LocalSession; @@ -8,7 +7,6 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.command.tool.Tool; import org.bukkit.Bukkit; -import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -16,7 +14,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemHeldEvent; -import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.plugin.Plugin; public class BrushListener implements Listener { @@ -49,24 +46,6 @@ public class BrushListener implements Listener { } } - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onPlayerMove(PlayerMoveEvent event) { - Location from = event.getFrom(); - Location to = event.getTo(); - if ((from.getYaw() != to.getYaw() && from.getPitch() != to.getPitch()) || from.getBlockX() != to.getBlockX() || from.getBlockZ() != to - .getBlockZ() || from.getBlockY() != to.getBlockY()) { - Player bukkitPlayer = event.getPlayer(); - com.sk89q.worldedit.entity.Player player = BukkitAdapter.adapt(bukkitPlayer); - LocalSession session = player.getSession(); - Tool tool = session.getTool(player); - if (tool != null) { - if (tool instanceof MovableTool) { - ((MovableTool) tool).move(player); - } - } - } - } - @EventHandler(priority = EventPriority.LOWEST) public void onPlayerInteract(final PlayerInteractEvent event) { Player bukkitPlayer = event.getPlayer(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index f35891656..876517dd6 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -23,6 +23,7 @@ import com.fastasyncworldedit.bukkit.BukkitPermissionAttachmentManager; import com.fastasyncworldedit.bukkit.FaweBukkit; import com.fastasyncworldedit.core.util.UpdateNotification; import com.fastasyncworldedit.core.Fawe; +import com.fastasyncworldedit.core.util.WEManager; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.sk89q.bukkit.util.ClassSourceValidator; @@ -58,6 +59,7 @@ import com.sk89q.worldedit.world.weather.WeatherTypes; import io.papermc.lib.PaperLib; import org.apache.logging.log4j.Logger; import org.bstats.bukkit.Metrics; +import org.bstats.charts.SimplePie; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -220,8 +222,10 @@ public class WorldEditPlugin extends JavaPlugin { } // Enable metrics - new Metrics(this, BSTATS_ID); - + Metrics m = new Metrics(this, BSTATS_ID); + // First introduced in build 349, release 2.5.2 + m.addCustomChart(new SimplePie("residence", () + -> WEManager.weManager().getManagers().toString().contains("residence") ? "Yes" : "No")); // Check if we are in a safe environment ServerLib.checkUnsafeForks(); // Check if a new build is available diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index a5d40bb13..21ccaa0b8 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -34,7 +34,6 @@ dependencies { implementation("org.apache.logging.log4j:log4j-api") // Plugins - compileOnly(libs.redprotect) { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } // ensure this is on the classpath for the AP diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java index a5b58fb93..76bbb9549 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java @@ -2,8 +2,16 @@ package com.fastasyncworldedit.core.command.tool; import com.sk89q.worldedit.entity.Player; +/** + * @deprecated This interface has no functionality anymore + */ +@Deprecated(forRemoval = true, since = "2.5.2") public interface MovableTool { + /** + * @deprecated This interface has no functionality anymore + */ + @Deprecated(forRemoval = true, since = "2.5.2") boolean move(Player player); } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/registry/state/PropertyKeySet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/registry/state/PropertyKeySet.java index 334692c88..2a1d4258d 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/registry/state/PropertyKeySet.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/registry/state/PropertyKeySet.java @@ -18,9 +18,9 @@ public class PropertyKeySet implements Set { public static PropertyKeySet ofCollection(Collection collection) { PropertyKeySet set = new PropertyKeySet(); - if (collection instanceof PropertyKeySet) { + if (collection instanceof PropertyKeySet pks) { // simple copy - set.bits.or(((PropertyKeySet) collection).bits); + set.bits.or(pks.bits); return set; } for (PropertyKey key : collection) { @@ -51,10 +51,10 @@ public class PropertyKeySet implements Set { @Override public boolean contains(Object o) { - if (!(o instanceof PropertyKey)) { + if (!(o instanceof PropertyKey pk)) { return false; } - return this.bits.get(((PropertyKey) o).getId()); + return this.bits.get(pk.getId()); } @Nonnull @@ -92,26 +92,26 @@ public class PropertyKeySet implements Set { @Override public boolean remove(Object o) { - if (!(o instanceof PropertyKey)) { + if (!(o instanceof PropertyKey pk)) { return false; } - if (!this.bits.get(((PropertyKey) o).getId())) { + if (!this.bits.get(pk.getId())) { return false; } - this.bits.clear(((PropertyKey) o).getId()); + this.bits.clear(pk.getId()); return true; } @Override public boolean containsAll(@Nonnull Collection c) { - if (c instanceof PropertyKeySet) { - return ((PropertyKeySet) c).bits.intersects(this.bits); + if (c instanceof PropertyKeySet pks) { + return pks.bits.intersects(this.bits); } for (Object o : c) { - if (!(o instanceof PropertyKey)) { + if (!(o instanceof PropertyKey pk)) { return false; } - if (!this.bits.get(((PropertyKey) o).getId())) { + if (!this.bits.get(pk.getId())) { return false; } } @@ -121,8 +121,8 @@ public class PropertyKeySet implements Set { @Override public boolean addAll(@Nonnull Collection c) { int cardinality = this.bits.cardinality(); - if (c instanceof PropertyKeySet) { - this.bits.or(((PropertyKeySet) c).bits); + if (c instanceof PropertyKeySet pks) { + this.bits.or(pks.bits); } else { for (PropertyKey key : c) { this.bits.set(key.getId()); @@ -135,8 +135,8 @@ public class PropertyKeySet implements Set { public boolean retainAll(@Nonnull Collection c) { int cardinality = this.bits.cardinality(); BitSet removal; - if (c instanceof PropertyKeySet) { - removal = ((PropertyKeySet) c).bits; + if (c instanceof PropertyKeySet pks) { + removal = pks.bits; } else { removal = new BitSet(this.bits.length()); for (PropertyKey key : this) { @@ -152,12 +152,12 @@ public class PropertyKeySet implements Set { @Override public boolean removeAll(@Nonnull Collection c) { int cardinality = this.bits.cardinality(); - if (c instanceof PropertyKeySet) { - this.bits.andNot(((PropertyKeySet) c).bits); + if (c instanceof PropertyKeySet pks) { + this.bits.andNot(pks.bits); } else { for (Object o : c) { // mh - if (o instanceof PropertyKey) { - this.bits.clear(((PropertyKey) o).getId()); + if (o instanceof PropertyKey pk) { + this.bits.clear(pk.getId()); } } }