diff --git a/.github/renovate.json b/.github/renovate.json index 787e44030..526af5a60 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -19,8 +19,6 @@ "net.fabricmc:fabric-loader", "net.fabricmc.fabric-api:fabric-api", "com.github.luben:zstd-jni", - "net.kyori", - "net.kyori:adventure-nbt", "org.jetbrains.kotlin.jvm", "log4j" ], diff --git a/buildSrc/src/main/kotlin/AdapterConfig.kt b/buildSrc/src/main/kotlin/AdapterConfig.kt index 21cab4c73..6cad58e3b 100644 --- a/buildSrc/src/main/kotlin/AdapterConfig.kt +++ b/buildSrc/src/main/kotlin/AdapterConfig.kt @@ -15,7 +15,7 @@ fun Project.applyPaperweightAdapterConfiguration() { dependencies { "implementation"(project(":worldedit-bukkit")) - "implementation"(platform("com.intellectualsites.bom:bom-1.18.x:1.31")) + "implementation"(platform("com.intellectualsites.bom:bom-newest:1.33")) } tasks.named("assemble") { diff --git a/buildSrc/src/main/kotlin/CommonJavaConfig.kt b/buildSrc/src/main/kotlin/CommonJavaConfig.kt index 759e45740..73389ce83 100644 --- a/buildSrc/src/main/kotlin/CommonJavaConfig.kt +++ b/buildSrc/src/main/kotlin/CommonJavaConfig.kt @@ -45,7 +45,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean "testImplementation"("org.mockito:mockito-core:5.1.1") "testImplementation"("org.mockito:mockito-junit-jupiter:5.1.1") "testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.9.2") - "implementation"(platform("com.intellectualsites.bom:bom-1.18.x:1.31")) + "implementation"(platform("com.intellectualsites.bom:bom-newest:1.33")) } // Java 8 turns on doclint which we fail diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e1d802e37..9ff63fb98 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ towny = "0.99.5.4" bstats = "3.0.2" sparsebitset = "1.2" parallelgzip = "1.0.5" -adventure = "4.9.3" +adventure = "4.14.0" truezip = "6.8.4" auto-value = "1.10.2" findbugs = "3.0.2" @@ -30,7 +30,6 @@ jchronic = "0.2.4a" lz4-java = "1.8.0" lz4-stream = "1.0.0" ## Internal -adventure-text-minimessage = "4.2.0-SNAPSHOT" text-adapter = "3.0.6" text = "3.0.4" piston = "0.5.7" diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 9a9ffd86b..a6d31be03 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -101,8 +101,8 @@ dependencies { compileOnly(libs.griefdefender) { isTransitive = false } compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false } - compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } - compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } + compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit") { isTransitive = false } + compileOnly("com.intellectualsites.plotsquared:plotsquared-core") { isTransitive = false } // Third party implementation("io.papermc:paperlib") @@ -183,7 +183,7 @@ tasks.named("shadowJar") { include(dependency("org.lz4:lz4-java:1.8.0")) } relocate("net.kyori", "com.fastasyncworldedit.core.adventure") { - include(dependency("net.kyori:adventure-nbt:4.9.3")) + include(dependency("net.kyori:adventure-nbt:4.14.0")) } relocate("com.zaxxer", "com.fastasyncworldedit.core.math") { include(dependency("com.zaxxer:SparseBitSet:1.2")) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java index 2e25c8c56..90db4368c 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java @@ -325,18 +325,9 @@ public class FaweBukkit implements IFawe, Listener { if (plotSquared == null) { return; } - if (PlotSquared.get().getVersion().version[0] == 6) { + if (PlotSquared.get().getVersion().version[0] == 7) { WEManager.weManager().addManager(new com.fastasyncworldedit.bukkit.regions.plotsquared.PlotSquaredFeature()); - LOGGER.info("Plugin 'PlotSquared' v6 found. Using it now."); - } else if (PlotSquared.get().getVersion().version[0] == 7) { - WEManager.weManager().addManager(new com.fastasyncworldedit.bukkit.regions.plotsquared.PlotSquaredFeature()); - LOGGER.error("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - LOGGER.error("!! !!"); - LOGGER.error("!! ERROR: PlotSquared v7 found. This FAWE version does not support PlotSquared V7 !!"); - LOGGER.error("!! Follow the instructions when notified of v7 release candidates and use FAWE from !!"); - LOGGER.error("!! https://ci.athion.net/job/FastAsyncWorldEdit-Pull-Requests/view/change-requests/job/PR-2075/ !!"); - LOGGER.error("!! !!"); - LOGGER.error("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + LOGGER.info("Plugin 'PlotSquared' v7 found. Using it now."); } else { LOGGER.error("Incompatible version of PlotSquared found. Please use PlotSquared v6."); LOGGER.info("https://www.spigotmc.org/resources/77506/"); diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java index 66a9ef369..4ef1a3d05 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java @@ -171,13 +171,11 @@ public class FaweDelegateRegionManager { .limitUnlimited() .changeSetNull() .build(); - File schematicFile = new File(hybridPlotWorld.getRoot(), "plot.schem"); + File schematicFile = new File(hybridPlotWorld.getSchematicRoot(), "plot.schem"); if (!schematicFile.exists()) { - schematicFile = new File(hybridPlotWorld.getRoot(), "plot.schematic"); + schematicFile = new File(hybridPlotWorld.getSchematicRoot(), "plot.schematic"); } - BlockVector3 to = plot.getBottomAbs().getBlockVector3().withY(Settings.Schematics.PASTE_ON_TOP - ? hybridPlotWorld.SCHEM_Y - : hybridPlotWorld.getMinBuildHeight()); + BlockVector3 to = plot.getBottomAbs().getBlockVector3().withY(hybridPlotWorld.getPlotYStart()); try { Clipboard clip = ClipboardFormats .findByFile(schematicFile) @@ -215,7 +213,7 @@ public class FaweDelegateRegionManager { ) { TaskManager.taskManager().async(() -> { synchronized (FaweDelegateRegionManager.class) { - //todo because of the following code this should proably be in the Bukkit module + //todo because of the following code this should probably be in the Bukkit module World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorldName())); World pos3World = BukkitAdapter.adapt(getWorld(swapPos.getWorldName())); EditSession sessionA = WorldEdit.getInstance().newEditSessionBuilder().world(pos1World) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweTrim.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweTrim.java index 8bfab4939..665fa47e4 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweTrim.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweTrim.java @@ -1,13 +1,15 @@ package com.fastasyncworldedit.bukkit.regions.plotsquared; import com.fastasyncworldedit.core.util.TaskManager; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.tag.Tag; +import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.command.CommandCategory; import com.plotsquared.core.command.CommandDeclaration; import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.command.SubCommand; import com.plotsquared.core.configuration.caption.StaticCaption; -import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.player.PlotPlayer; @@ -33,7 +35,7 @@ public class FaweTrim extends SubCommand { return false; } if (!PlotSquared.platform().worldUtil().isWorld(strings[0])) { - plotPlayer.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Templates.of("value", strings[0])); + plotPlayer.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), TagResolver.resolver("value", Tag.inserting(Component.text(strings[0])))); return false; } ran = true; diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSetBiome.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSetBiome.java index cb007bfb3..ef903b716 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSetBiome.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSetBiome.java @@ -6,11 +6,9 @@ import com.plotsquared.core.command.CommandCategory; import com.plotsquared.core.command.CommandDeclaration; import com.plotsquared.core.command.MainCommand; import com.plotsquared.core.command.RequiredType; -import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; -import com.plotsquared.core.util.Permissions; import com.plotsquared.core.util.StringMan; import com.plotsquared.core.util.task.RunnableVal2; import com.plotsquared.core.util.task.RunnableVal3; @@ -24,6 +22,9 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.biome.Biomes; import com.sk89q.worldedit.world.registry.BiomeRegistry; +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 java.util.Collection; @@ -56,7 +57,7 @@ public class PlotSetBiome extends Command { ) throws CommandException { final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot")); checkTrue( - plot.isOwner(player.getUUID()) || Permissions.hasPermission(player, "plots.admin.command.generatebiome"), + plot.isOwner(player.getUUID()) || player.hasPermission("plots.admin.command.generatebiome"), TranslatableCaption.of("permission.no_plot_perms") ); if (plot.getRunning() != 0) { @@ -64,7 +65,7 @@ public class PlotSetBiome extends Command { return null; } checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"), - Templates.of("value", getUsage()) + TagResolver.resolver("value", Tag.inserting(Component.text(getUsage()))) ); final Set regions = plot.getRegions(); BiomeRegistry biomeRegistry = @@ -80,7 +81,7 @@ public class PlotSetBiome extends Command { player.sendMessage(TranslatableCaption.of("biome.need_biome")); player.sendMessage( TranslatableCaption.of("commandconfig.subcommand_set_options_header"), - Templates.of("values", biomes) + TagResolver.resolver("value", Tag.inserting(Component.text(biomes))) ); return CompletableFuture.completedFuture(false); } diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java index a34fac51f..e1ac20617 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java @@ -42,7 +42,7 @@ public class PlotSquaredFeature extends FaweMaskManager { if (Settings.FAWE_Components.FAWE_HOOK) { Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS = false; if (Settings.PLATFORM.toLowerCase(Locale.ROOT).startsWith("bukkit")) { - new FaweTrim(); + // new FaweTrim(); } // TODO: revisit this later on /* diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index 9ef3d3894..981812e1b 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -19,6 +19,8 @@ package com.sk89q.wepif; +import com.destroystokyo.paper.profile.PlayerProfile; +import org.bukkit.BanEntry; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.OfflinePlayer; @@ -30,10 +32,11 @@ import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; -import org.bukkit.profile.PlayerProfile; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; @@ -158,6 +161,15 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible { throw new UnsupportedOperationException("Not supported yet."); } + @Override + public @Nullable BanEntry ban( + @Nullable final String reason, + @Nullable final Date expires, + @Nullable final String source + ) { + return null; + } + @Override public boolean isWhitelisted() { throw new UnsupportedOperationException("Not supported yet."); @@ -323,4 +335,9 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible { } + @Override + public @Nullable Location getLastDeathLocation() { + return null; + } + } diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index c9b34d5b1..4e624bd3b 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -28,14 +28,13 @@ dependencies { implementation("com.google.code.gson:gson") // Platform expectations - // TODO update bom-newest - implementation("org.yaml:snakeyaml:2.0") + implementation("org.yaml:snakeyaml") // Logging implementation("org.apache.logging.log4j:log4j-api") // Plugins - compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } + compileOnly("com.intellectualsites.plotsquared:plotsquared-core") { isTransitive = false } // ensure this is on the classpath for the AP annotationProcessor(libs.guava)