From 85a7986f6b18db5cc4f0a8470120d5af771119b9 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Fri, 9 Jun 2023 21:51:22 +0200 Subject: [PATCH 1/5] Update to PlotSquared v7 --- renovate.json => .github/renovate.json | 0 build.gradle.kts | 7 +++++-- src/main/java/com/plotsquared/holoplots/PSHoloUtil.java | 9 ++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) rename renovate.json => .github/renovate.json (100%) diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json diff --git a/build.gradle.kts b/build.gradle.kts index 99fecf9a..e0e7ffc7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,11 +28,14 @@ repositories { maven { url = uri("https://repo.codemc.io/repository/maven-public/") } maven { url = uri("https://repo.dmulloy2.net/nexus/repository/public/") } maven { url = uri("https://maven.enginehub.org/repo/") } + // TODO remove once this is part of BOM + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") } dependencies { - implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.27")) - compileOnly("com.plotsquared:PlotSquared-Bukkit") + implementation(platform("com.intellectualsites.bom:bom-newest:1.29")) + // TODO remove version once this is part of BOM + compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit:7.0.0-SNAPSHOT") compileOnly("io.papermc.paper:paper-api") compileOnly(libs.holographicdisplays) compileOnly(libs.protocollib) diff --git a/src/main/java/com/plotsquared/holoplots/PSHoloUtil.java b/src/main/java/com/plotsquared/holoplots/PSHoloUtil.java index 400a5e13..79bf6eb0 100644 --- a/src/main/java/com/plotsquared/holoplots/PSHoloUtil.java +++ b/src/main/java/com/plotsquared/holoplots/PSHoloUtil.java @@ -25,7 +25,9 @@ import me.filoghost.holographicdisplays.api.hologram.VisibilitySettings; import me.filoghost.holographicdisplays.api.hologram.line.ItemHologramLine; import me.filoghost.holographicdisplays.api.hologram.line.TextHologramLine; -import net.kyori.adventure.text.minimessage.Template; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.tag.Tag; +import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -209,8 +211,9 @@ private String translate(Plot plot, Caption caption) { name = "unknown"; } return BukkitUtil.LEGACY_COMPONENT_SERIALIZER - .serialize(BukkitUtil.MINI_MESSAGE.parse(caption.getComponent(LocaleHolder.console()), Template.of("id", id), - Template.of("owner", name) + .serialize(BukkitUtil.MINI_MESSAGE.deserialize(caption.getComponent(LocaleHolder.console()), + TagResolver.resolver("id", Tag.inserting(Component.text(id))), + TagResolver.resolver("owner", Tag.inserting(Component.text(name))) )) .replace("Claimed", plot.getOwnerAbs() == null ? "" : "Claimed"); } From 6d7507e322cf32bde4c01820f296aaf6071b9249 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Fri, 9 Jun 2023 21:59:02 +0200 Subject: [PATCH 2/5] Don't load on versions prior to v7 --- .../java/com/plotsquared/holoplots/HoloPlotsPlugin.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/plotsquared/holoplots/HoloPlotsPlugin.java b/src/main/java/com/plotsquared/holoplots/HoloPlotsPlugin.java index 546f5cda..105e7dad 100644 --- a/src/main/java/com/plotsquared/holoplots/HoloPlotsPlugin.java +++ b/src/main/java/com/plotsquared/holoplots/HoloPlotsPlugin.java @@ -20,6 +20,13 @@ public class HoloPlotsPlugin extends JavaPlugin { @Override public void onEnable() { + if (!Bukkit.getPluginManager().getPlugin("PlotSquared").getDescription().getVersion().startsWith("7")) { + getLogger().severe("PlotSquared 7.x is required for HoloPlots to work!"); + getLogger().severe("Please update PlotSquared: https://www.spigotmc.org/resources/77506/"); + getLogger().severe("Disabling HoloPlots..."); + Bukkit.getPluginManager().disablePlugin(this); + return; + } if (!Bukkit.getPluginManager().getPlugin("HolographicDisplays").getDescription().getVersion().startsWith("3")) { getLogger().severe("HolographicDisplays 3.x is required for HoloPlots to work!"); getLogger().severe("Please update HolographicDisplays: https://dev.bukkit.org/projects/holographic-displays/files"); From e8c5e78e4a1866f4e8db1579b89d6d63a9657918 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Fri, 9 Jun 2023 22:02:37 +0200 Subject: [PATCH 3/5] Major version bump --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index e0e7ffc7..0a1af6b3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ configurations.all { attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17) } -version = "6.3.1-SNAPSHOT" +version = "7.0.0-SNAPSHOT" repositories { mavenCentral() From f2080a1b780a5d4dc24529a82da7f843689e7234 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Wed, 5 Jul 2023 14:12:03 +0200 Subject: [PATCH 4/5] Bump bom --- build.gradle.kts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0a1af6b3..f69191f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,14 +28,11 @@ repositories { maven { url = uri("https://repo.codemc.io/repository/maven-public/") } maven { url = uri("https://repo.dmulloy2.net/nexus/repository/public/") } maven { url = uri("https://maven.enginehub.org/repo/") } - // TODO remove once this is part of BOM - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") } dependencies { - implementation(platform("com.intellectualsites.bom:bom-newest:1.29")) - // TODO remove version once this is part of BOM - compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit:7.0.0-SNAPSHOT") + implementation(platform("com.intellectualsites.bom:bom-newest:1.31")) + compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit") compileOnly("io.papermc.paper:paper-api") compileOnly(libs.holographicdisplays) compileOnly(libs.protocollib) From c961fe6cac47031d813a711084d42e1c8debb52d Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Wed, 5 Jul 2023 15:18:07 +0200 Subject: [PATCH 5/5] Bump bom --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f69191f5..310fc5bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation(platform("com.intellectualsites.bom:bom-newest:1.31")) + implementation(platform("com.intellectualsites.bom:bom-newest:1.32")) compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit") compileOnly("io.papermc.paper:paper-api") compileOnly(libs.holographicdisplays)