From ef2f2589d26a811cc9cee62df61d90a0a10fbe51 Mon Sep 17 00:00:00 2001 From: szumielxd <43210079+szumielxd@users.noreply.github.com> Date: Tue, 28 Jan 2025 22:03:32 +0100 Subject: [PATCH] Moved from jetbrains to javax annotations --- .../plotsquared/core/command/MainCommand.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java index aa8fa8ce0d..cd790cfe84 100644 --- a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java @@ -40,8 +40,6 @@ import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.Arrays; import java.util.LinkedList; @@ -50,6 +48,9 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * PlotSquared command class. */ @@ -283,7 +284,7 @@ private CompletableFuture> prepareArguments(Comma } private CompletableFuture> preparePlotArgument(@Nullable Plot newPlot, - @NotNull CommandExecutionData data, + @Nonnull CommandExecutionData data, @Nullable PlotArea area) { if (newPlot != null && (data.player() instanceof ConsolePlayer || (area != null && area.equals(newPlot.getArea())) @@ -310,7 +311,7 @@ private CompletableFuture> preparePlotArgument(@N return CompletableFuture.completedFuture(Optional.of(data)); } - private Optional prepareFlagArgument(@NotNull CommandExecutionData data, @NotNull PlotArea area) { + private Optional prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) { if (data.args().length >= 2 && !data.args()[0].isEmpty() && data.args()[0].charAt(0) == '-') { if ("f".equals(data.args()[0].substring(1))) { return Optional.of(new CommandExecutionData( @@ -337,7 +338,7 @@ private CompletableFuture fetchPlotCenterLocation(Plot plot) { return future; } - private @NotNull RunnableVal3 createForcedConfirmation(@NotNull PlotPlayer player, + private @Nonnull RunnableVal3 createForcedConfirmation(@Nonnull PlotPlayer player, @Nullable PlotArea area) { return new RunnableVal3<>() { @Override @@ -360,7 +361,7 @@ public void run(Command cmd, Runnable success, Runnable failure) { }; } - private @NotNull TemporaryCommandMeta setCommandScope(@NotNull PlotPlayer player, @NotNull TemporaryCommandMeta commandMeta) { + private @Nonnull TemporaryCommandMeta setCommandScope(@Nonnull PlotPlayer player, @Nonnull TemporaryCommandMeta commandMeta) { Objects.requireNonNull(commandMeta.location()); Objects.requireNonNull(commandMeta.plot()); Location location; @@ -378,7 +379,7 @@ public void run(Command cmd, Runnable success, Runnable failure) { return new TemporaryCommandMeta(location, plot); } - private void resetCommandScope(@NotNull PlotPlayer player, @NotNull TemporaryCommandMeta commandMeta) { + private void resetCommandScope(@Nonnull PlotPlayer player, @Nonnull TemporaryCommandMeta commandMeta) { try (final MetaDataAccess locationMetaDataAccess = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LOCATION)) { if (commandMeta.location() == null) { @@ -397,9 +398,9 @@ private void resetCommandScope(@NotNull PlotPlayer player, @NotNull Temporary } } - private record CommandExecutionData(@NotNull PlotPlayer player, @NotNull String[] args, - @NotNull RunnableVal3 confirm, - @NotNull RunnableVal2 whenDone, + private record CommandExecutionData(@Nonnull PlotPlayer player, @Nonnull String[] args, + @Nonnull RunnableVal3 confirm, + @Nonnull RunnableVal2 whenDone, @Nullable TemporaryCommandMeta postCommandData) {} private record TemporaryCommandMeta(@Nullable Location location, @Nullable Plot plot) {}