diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bee920ea9..46822810d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,41 +26,3 @@ jobs: else echo "STATUS=release" >> $GITHUB_ENV fi - - name: Publish Release - if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository - env: - ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} - ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} - - name: Publish Snapshot - if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }} - run: ./gradlew publishToSonatype - env: - ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} - ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} - - name: Publish core javadoc - if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} - with: - source-directory: 'Core/build/docs/javadoc' - destination-github-username: 'IntellectualSites' - destination-repository-name: 'plotsquared-javadocs' - user-email: ${{ secrets.USER_EMAIL }} - target-branch: main - target-directory: core - - name: Publish bukkit javadoc - if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} - with: - source-directory: 'Bukkit/build/docs/javadoc' - destination-github-username: 'IntellectualSites' - destination-repository-name: 'plotsquared-javadocs' - user-email: ${{ secrets.USER_EMAIL }} - target-branch: main - target-directory: bukkit diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java index 4507414c3..9a396af73 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -114,6 +114,10 @@ import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.bukkit.Tag.CORALS; +import static org.bukkit.Tag.CORAL_BLOCKS; +import static org.bukkit.Tag.WALL_CORALS; + @SuppressWarnings("unused") public class BlockEventListener implements Listener { @@ -734,7 +738,7 @@ public class BlockEventListener implements Listener { } return; } - if (Tag.CORAL_BLOCKS.isTagged(blockType) || Tag.CORALS.isTagged(blockType) || Tag.WALL_CORALS.isTagged(blockType)) { + if (CORAL_BLOCKS.isTagged(blockType) || CORALS.isTagged(blockType) || WALL_CORALS.isTagged(blockType)) { if (!plot.getFlag(CoralDryFlag.class)) { plot.debug("Coral could not dry because coral-dry = false"); event.setCancelled(true); @@ -787,7 +791,10 @@ public class BlockEventListener implements Listener { } if (toPlot != null) { - if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals(toPlot, toArea.getOwnedPlot(fromLocation))) { + if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals( + toPlot, + toArea.getOwnedPlot(fromLocation) + )) { event.setCancelled(true); return; } @@ -803,7 +810,10 @@ public class BlockEventListener implements Listener { toPlot.debug("Liquid could not flow because liquid-flow = disabled"); event.setCancelled(true); } - } else if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals(null, toArea.getOwnedPlot(fromLocation))) { + } else if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals( + null, + toArea.getOwnedPlot(fromLocation) + )) { event.setCancelled(true); } else if (event.getBlock().isLiquid()) { final org.bukkit.Location location = event.getBlock().getLocation(); @@ -1298,11 +1308,13 @@ public class BlockEventListener implements Listener { .tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight()))) .build() ); - if (area.notifyIfOutsideBuildArea(pp, currentLocation.getY())) { - event.setCancelled(true); - break; + if (area.notifyIfOutsideBuildArea(pp, currentLocation.getY())) { + event.setCancelled(true); + break; + } } } + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java index 1af1034a9..9542bddbf 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java @@ -25,7 +25,6 @@ import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.core.location.ChunkWrapper; import com.plotsquared.core.location.Location; import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator; -import com.plotsquared.core.util.AnnotationHelper; import com.plotsquared.core.util.ChunkUtil; import com.plotsquared.core.util.PatternUtil; import com.sk89q.worldedit.bukkit.BukkitAdapter; @@ -45,7 +44,10 @@ import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Arrays; -@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") +/** + * Internal use only. Subject to changes at any time. + */ +@DoNotUse public class GenChunk extends ZeroedDelegateScopedQueueCoordinator { public final Biome[] biomes; diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java index 214b1474e..054cad0c2 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java @@ -28,7 +28,6 @@ import com.plotsquared.core.generator.HybridUtils; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; -import com.plotsquared.core.plot.expiration.ExpireManager; import com.plotsquared.core.plot.expiration.PlotAnalysis; import com.plotsquared.core.plot.flag.GlobalFlagContainer; import com.plotsquared.core.plot.flag.PlotFlag; diff --git a/Core/src/main/java/com/plotsquared/core/command/Merge.java b/Core/src/main/java/com/plotsquared/core/command/Merge.java index 539daddfa..614e1cdc5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Merge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Merge.java @@ -304,14 +304,14 @@ public class Merge extends SubCommand { if (!force && this.econHandler.getMoney(player) < price) { player.sendMessage( TranslatableCaption.of("economy.cannot_afford_merge"), - Template.of("money", this.econHandler.format(price)) + TagResolver.resolver("money", Tag.inserting(Component.text(this.econHandler.format(price)))) ); return false; } this.econHandler.withdrawMoney(player, price); player.sendMessage( TranslatableCaption.of("economy.removed_balance"), - Template.of("money", this.econHandler.format(price)) + TagResolver.resolver("money", Tag.inserting(Component.text(this.econHandler.format(price)))) ); } player.sendMessage(TranslatableCaption.of("merge.success_merge")); diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 6599f0529..7376bf130 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -40,6 +40,7 @@ import com.plotsquared.core.location.Location; import com.plotsquared.core.permissions.Permission; import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.plot.expiration.ExpireManager; import com.plotsquared.core.plot.expiration.PlotAnalysis; import com.plotsquared.core.plot.flag.FlagContainer; import com.plotsquared.core.plot.flag.GlobalFlagContainer; @@ -2823,7 +2824,8 @@ public class Plot { ComponentLike members = PlayerManager.getPlayerList(this.getMembers(), player); ComponentLike denied = PlayerManager.getPlayerList(this.getDenied(), player); ComponentLike seen; - if (Settings.Enabled_Components.PLOT_EXPIRY && ExpireManager.IMP != null) { + ExpireManager expireManager = PlotSquared.platform().expireManager(); + if (Settings.Enabled_Components.PLOT_EXPIRY && expireManager != null) { if (this.isOnline()) { seen = TranslatableCaption.of("info.now").toComponent(player); } else { diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java index 6717a21c0..bff7c94b2 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java @@ -657,8 +657,10 @@ public abstract class PlotArea implements ComponentLike { if (!buildRangeContainsY(y) && !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { player.sendMessage( TranslatableCaption.of("height.height_limit"), - Template.of("minHeight", String.valueOf(minBuildHeight)), - Template.of("maxHeight", String.valueOf(maxBuildHeight)) + TagResolver.builder() + .tag("minHeight", Tag.inserting(Component.text(minBuildHeight))) + .tag("maxHeight", + Tag.inserting(Component.text(maxBuildHeight))).build() ); // Return true if "failed" as the method will always be inverted otherwise return true; diff --git a/Core/src/main/java/com/plotsquared/core/queue/BlockArrayCacheScopedQueueCoordinator.java b/Core/src/main/java/com/plotsquared/core/queue/BlockArrayCacheScopedQueueCoordinator.java index 58d33af98..4876cb45d 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/BlockArrayCacheScopedQueueCoordinator.java +++ b/Core/src/main/java/com/plotsquared/core/queue/BlockArrayCacheScopedQueueCoordinator.java @@ -18,7 +18,7 @@ */ package com.plotsquared.core.queue; -import com.intellectualsites.annotations.DoNotUse; +import com.intellectualsites.annotations.NotPublic; import com.plotsquared.core.location.Location; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.function.pattern.Pattern; @@ -36,8 +36,10 @@ import org.checkerframework.checker.nullness.qual.Nullable; * The min and max points of this queue are offset according to the minimum point given in the constructor, and the offsets set * in {@link BlockArrayCacheScopedQueueCoordinator#setOffsetX(int)} and * {@link BlockArrayCacheScopedQueueCoordinator#setOffsetZ(int)} + * + * Internal use only. Subject to change at any time and created for specific use cases. */ -@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to change at any time and created for specific use cases.") +@NotPublic public class BlockArrayCacheScopedQueueCoordinator extends ZeroedDelegateScopedQueueCoordinator { private final BlockState[][][] blockStates; diff --git a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java index 4d5e6f9b3..e9f0cf8ce 100644 --- a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java +++ b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java @@ -338,8 +338,10 @@ public class EventDispatcher { .hasPermission(player, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { player.sendMessage( TranslatableCaption.of("height.height_limit"), - Template.of("minHeight", String.valueOf(area.getMinBuildHeight())), - Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight())) + TagResolver.builder() + .tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight()))) + .tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight()))) + .build() ); return false; }