From b65f3ce1f833d0147414a50ee06a3a63786f5126 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Tue, 7 Feb 2023 10:47:49 +0100 Subject: [PATCH 1/9] Add metrics for Residence (#2081) --- gradle/libs.versions.toml | 4 ---- worldedit-bukkit/build.gradle.kts | 1 - .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 7 +++++-- worldedit-core/build.gradle.kts | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a442bd1a..f85477375 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" @@ -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/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index f35891656..66bff5930 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,9 @@ public class WorldEditPlugin extends JavaPlugin { } // Enable metrics - new Metrics(this, BSTATS_ID); - + Metrics m = new Metrics(this, BSTATS_ID); + 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 -- 2.39.5 From 07217d0b815f286b80b624ff11e68817ac0e0b82 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Tue, 7 Feb 2023 22:50:21 +0100 Subject: [PATCH 2/9] [ci skip] Document metrics addition --- .../main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 1 + 1 file changed, 1 insertion(+) 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 66bff5930..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 @@ -223,6 +223,7 @@ public class WorldEditPlugin extends JavaPlugin { // Enable metrics 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 -- 2.39.5 From f9d6b127e6eb77ceb95c72d9f2b9e35d863338d5 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 7 Feb 2023 23:07:31 +0100 Subject: [PATCH 3/9] Use Pattern Matching for instanceof in PropertyKeySet (#2086) --- .../core/registry/state/PropertyKeySet.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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()); } } } -- 2.39.5 From 321a39f12176832795409908914156228badc746 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 7 Feb 2023 23:07:57 +0100 Subject: [PATCH 4/9] Remove PlayerMoveEvent listener and deprecate MovableTool (#2083) Remove PlayerMoveEventListener and deprecate MovableTool --- .../bukkit/listener/BrushListener.java | 21 ------------------- .../core/command/tool/MovableTool.java | 8 +++++++ 2 files changed, 8 insertions(+), 21 deletions(-) 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-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..d38db7dca 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 = "TODO") public interface MovableTool { + /** + * @deprecated This interface has no functionality anymore + */ + @Deprecated(forRemoval = true, since = "TODO") boolean move(Player player); } -- 2.39.5 From 19ed349740f824b447a0a3f502c2181ae892b5d6 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Tue, 7 Feb 2023 23:13:05 +0100 Subject: [PATCH 5/9] Release 2.5.2 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index eac46709c..2bae334f4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ ext { } } -version = String.format("%s-%s", rootVersion, buildNumber) +version = String.format("%s", rootVersion) if (!project.hasProperty("gitCommitHash")) { apply(plugin = "org.ajoberstar.grgit") -- 2.39.5 From 1e5b2fe0de80cd10e1d7ea185273d0011a4e9f10 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Tue, 7 Feb 2023 23:25:17 +0100 Subject: [PATCH 6/9] Back to snapshot for development --- build.gradle.kts | 4 ++-- .../com/fastasyncworldedit/core/command/tool/MovableTool.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2bae334f4..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("") @@ -51,7 +51,7 @@ ext { } } -version = String.format("%s", rootVersion) +version = String.format("%s-%s", rootVersion, buildNumber) if (!project.hasProperty("gitCommitHash")) { apply(plugin = "org.ajoberstar.grgit") 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 d38db7dca..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 @@ -5,13 +5,13 @@ import com.sk89q.worldedit.entity.Player; /** * @deprecated This interface has no functionality anymore */ -@Deprecated(forRemoval = true, since = "TODO") +@Deprecated(forRemoval = true, since = "2.5.2") public interface MovableTool { /** * @deprecated This interface has no functionality anymore */ - @Deprecated(forRemoval = true, since = "TODO") + @Deprecated(forRemoval = true, since = "2.5.2") boolean move(Player player); } -- 2.39.5 From 783dc353c401c6a6240fbbb8972b1f61568b2dfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:48:52 +0100 Subject: [PATCH 7/9] Update dependency io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin to v1.5.0 (#2090) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ba983666c..acaac3688 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.0") } kotlin { -- 2.39.5 From 8832820b6c7dced75f6e89a2612a6a8cce192bb9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Feb 2023 12:11:04 +0100 Subject: [PATCH 8/9] Update dependency io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin to v1.5.1 (#2095) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index acaac3688..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.5.0") + implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.1") } kotlin { -- 2.39.5 From b72c6902e2e87bd953987f19b60ae43105c40a22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:49:54 +0100 Subject: [PATCH 9/9] Update antlr4 to v4.12.0 (#2103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f85477375..83638067a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -23,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" -- 2.39.5