From 4db3b9317de01750c043cb6d4812df19d1e6b662 Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 20 Jun 2021 21:48:07 +0200 Subject: [PATCH] Replace google Beta annotation to jetbrains ApiStatus.Experimental --- .../java/net/minestom/server/acquirable/Acquirable.java | 3 +-- .../minestom/server/acquirable/AcquirableCollection.java | 4 ++-- .../java/net/minestom/server/command/builder/Command.java | 8 ++++---- .../server/command/builder/arguments/Argument.java | 6 +++--- .../server/command/builder/arguments/ArgumentCommand.java | 4 ++-- .../server/command/builder/arguments/ArgumentType.java | 4 ++-- .../server/command/builder/parser/ArgumentParser.java | 4 ++-- src/main/java/net/minestom/server/entity/Entity.java | 5 ++--- .../java/net/minestom/server/item/ItemStackBuilder.java | 4 ++-- src/main/java/net/minestom/server/tag/TagHandler.java | 4 ++-- .../minestom/server/utils/location/RelativeLocation.java | 6 +++--- 11 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/main/java/net/minestom/server/acquirable/Acquirable.java b/src/main/java/net/minestom/server/acquirable/Acquirable.java index 0781550de..b1f290e85 100644 --- a/src/main/java/net/minestom/server/acquirable/Acquirable.java +++ b/src/main/java/net/minestom/server/acquirable/Acquirable.java @@ -1,6 +1,5 @@ package net.minestom.server.acquirable; -import com.google.common.annotations.Beta; import net.minestom.server.entity.Entity; import net.minestom.server.thread.ThreadProvider; import net.minestom.server.thread.TickThread; @@ -14,7 +13,7 @@ import java.util.Optional; import java.util.function.Consumer; import java.util.stream.Stream; -@Beta +@ApiStatus.Experimental public interface Acquirable { /** diff --git a/src/main/java/net/minestom/server/acquirable/AcquirableCollection.java b/src/main/java/net/minestom/server/acquirable/AcquirableCollection.java index 225a725d4..0114d79e1 100644 --- a/src/main/java/net/minestom/server/acquirable/AcquirableCollection.java +++ b/src/main/java/net/minestom/server/acquirable/AcquirableCollection.java @@ -1,15 +1,15 @@ package net.minestom.server.acquirable; -import com.google.common.annotations.Beta; import net.minestom.server.thread.TickThread; import net.minestom.server.utils.async.AsyncUtils; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.function.Consumer; import java.util.stream.Stream; -@Beta +@ApiStatus.Experimental public class AcquirableCollection implements Collection> { private final Collection> acquirableCollection; diff --git a/src/main/java/net/minestom/server/command/builder/Command.java b/src/main/java/net/minestom/server/command/builder/Command.java index d7907626d..d85681794 100644 --- a/src/main/java/net/minestom/server/command/builder/Command.java +++ b/src/main/java/net/minestom/server/command/builder/Command.java @@ -1,6 +1,5 @@ package net.minestom.server.command.builder; -import com.google.common.annotations.Beta; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import net.minestom.server.command.CommandSender; @@ -10,6 +9,7 @@ import net.minestom.server.command.builder.arguments.ArgumentType; import net.minestom.server.command.builder.arguments.ArgumentWord; import net.minestom.server.command.builder.condition.CommandCondition; import net.minestom.server.utils.StringUtils; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; @@ -221,7 +221,7 @@ public class Command { * @param format the syntax format * @return the newly created {@link CommandSyntax syntaxes}. */ - @Beta + @ApiStatus.Experimental public @NotNull Collection addSyntax(@NotNull CommandExecutor executor, @NotNull String format) { return addSyntax(executor, ArgumentType.generate(format)); } @@ -302,7 +302,7 @@ public class Command { public void globalListener(@NotNull CommandSender sender, @NotNull CommandContext context, @NotNull String command) { } - @Beta + @ApiStatus.Experimental public @NotNull Set getSyntaxesStrings() { Set syntaxes = new HashSet<>(); @@ -320,7 +320,7 @@ public class Command { return syntaxes; } - @Beta + @ApiStatus.Experimental public @NotNull String getSyntaxesTree() { Node commandNode = new Node(); commandNode.names.addAll(Arrays.asList(getNames())); diff --git a/src/main/java/net/minestom/server/command/builder/arguments/Argument.java b/src/main/java/net/minestom/server/command/builder/arguments/Argument.java index 6f67e767a..df02b9ca3 100644 --- a/src/main/java/net/minestom/server/command/builder/arguments/Argument.java +++ b/src/main/java/net/minestom/server/command/builder/arguments/Argument.java @@ -1,6 +1,5 @@ package net.minestom.server.command.builder.arguments; -import com.google.common.annotations.Beta; import net.minestom.server.command.builder.ArgumentCallback; import net.minestom.server.command.builder.Command; import net.minestom.server.command.builder.CommandExecutor; @@ -8,6 +7,7 @@ import net.minestom.server.command.builder.NodeMaker; import net.minestom.server.command.builder.exception.ArgumentSyntaxException; import net.minestom.server.command.builder.suggestion.SuggestionCallback; import net.minestom.server.network.packet.server.play.DeclareCommandsPacket; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -210,8 +210,8 @@ public abstract class Argument { /** * Gets the suggestion callback of the argument * - * @see #setSuggestionCallback * @return the suggestion callback of the argument, null if it doesn't exist + * @see #setSuggestionCallback */ @Nullable public SuggestionCallback getSuggestionCallback() { @@ -247,7 +247,7 @@ public abstract class Argument { * @param The type of output expected. * @return A new ArgumentMap that can get this complex object type. */ - @Beta + @ApiStatus.Experimental public @NotNull ArgumentMap map(@NotNull ArgumentMap.Mapper mapper) { return new ArgumentMap<>(this, mapper); } diff --git a/src/main/java/net/minestom/server/command/builder/arguments/ArgumentCommand.java b/src/main/java/net/minestom/server/command/builder/arguments/ArgumentCommand.java index 335be5300..7068ffedc 100644 --- a/src/main/java/net/minestom/server/command/builder/arguments/ArgumentCommand.java +++ b/src/main/java/net/minestom/server/command/builder/arguments/ArgumentCommand.java @@ -1,6 +1,5 @@ package net.minestom.server.command.builder.arguments; -import com.google.common.annotations.Beta; import net.minestom.server.MinecraftServer; import net.minestom.server.command.builder.CommandDispatcher; import net.minestom.server.command.builder.CommandResult; @@ -8,6 +7,7 @@ import net.minestom.server.command.builder.NodeMaker; import net.minestom.server.command.builder.exception.ArgumentSyntaxException; import net.minestom.server.network.packet.server.play.DeclareCommandsPacket; import net.minestom.server.utils.StringUtils; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; public class ArgumentCommand extends Argument { @@ -69,7 +69,7 @@ public class ArgumentCommand extends Argument { return shortcut; } - @Beta + @ApiStatus.Experimental public ArgumentCommand setShortcut(@NotNull String shortcut) { this.shortcut = shortcut; return this; diff --git a/src/main/java/net/minestom/server/command/builder/arguments/ArgumentType.java b/src/main/java/net/minestom/server/command/builder/arguments/ArgumentType.java index 16eaf03f3..dc9ebc4e4 100644 --- a/src/main/java/net/minestom/server/command/builder/arguments/ArgumentType.java +++ b/src/main/java/net/minestom/server/command/builder/arguments/ArgumentType.java @@ -1,6 +1,5 @@ package net.minestom.server.command.builder.arguments; -import com.google.common.annotations.Beta; import net.minestom.server.command.builder.arguments.minecraft.*; import net.minestom.server.command.builder.arguments.minecraft.registry.*; import net.minestom.server.command.builder.arguments.number.ArgumentDouble; @@ -11,6 +10,7 @@ import net.minestom.server.command.builder.arguments.relative.ArgumentRelativeBl import net.minestom.server.command.builder.arguments.relative.ArgumentRelativeVec2; import net.minestom.server.command.builder.arguments.relative.ArgumentRelativeVec3; import net.minestom.server.command.builder.parser.ArgumentParser; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** @@ -248,7 +248,7 @@ public class ArgumentType { *

* Note: this feature is in beta and is very likely to change depending on feedback. */ - @Beta + @ApiStatus.Experimental public static Argument[] generate(@NotNull String format) { return ArgumentParser.generate(format); } diff --git a/src/main/java/net/minestom/server/command/builder/parser/ArgumentParser.java b/src/main/java/net/minestom/server/command/builder/parser/ArgumentParser.java index 0c51c8aa5..39c246df1 100644 --- a/src/main/java/net/minestom/server/command/builder/parser/ArgumentParser.java +++ b/src/main/java/net/minestom/server/command/builder/parser/ArgumentParser.java @@ -1,6 +1,5 @@ package net.minestom.server.command.builder.parser; -import com.google.common.annotations.Beta; import net.minestom.server.command.builder.arguments.*; import net.minestom.server.command.builder.arguments.minecraft.*; import net.minestom.server.command.builder.arguments.minecraft.registry.*; @@ -12,6 +11,7 @@ import net.minestom.server.command.builder.arguments.relative.ArgumentRelativeVe import net.minestom.server.command.builder.arguments.relative.ArgumentRelativeVec3; import net.minestom.server.command.builder.exception.ArgumentSyntaxException; import net.minestom.server.utils.StringUtils; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -63,7 +63,7 @@ public class ArgumentParser { ARGUMENT_FUNCTION_MAP.put("relativevec2", ArgumentRelativeVec2::new); } - @Beta + @ApiStatus.Experimental public static @NotNull Argument[] generate(@NotNull String format) { List> result = new ArrayList<>(); diff --git a/src/main/java/net/minestom/server/entity/Entity.java b/src/main/java/net/minestom/server/entity/Entity.java index ad678cd0d..68966e023 100644 --- a/src/main/java/net/minestom/server/entity/Entity.java +++ b/src/main/java/net/minestom/server/entity/Entity.java @@ -1,6 +1,5 @@ package net.minestom.server.entity; -import com.google.common.annotations.Beta; import com.google.common.collect.Queues; import net.kyori.adventure.sound.Sound; import net.kyori.adventure.text.Component; @@ -1620,12 +1619,12 @@ public class Entity implements Viewable, Tickable, EventHandler, Da return Objects.requireNonNullElse(this.customSynchronizationCooldown, SYNCHRONIZATION_COOLDOWN); } - @Beta + @ApiStatus.Experimental public @NotNull Acquirable getAcquirable() { return (Acquirable) acquirable; } - @Beta + @ApiStatus.Experimental public @NotNull Acquirable getAcquirable(@NotNull Class clazz) { return (Acquirable) acquirable; } diff --git a/src/main/java/net/minestom/server/item/ItemStackBuilder.java b/src/main/java/net/minestom/server/item/ItemStackBuilder.java index 12b0b8a3a..75a2b42f7 100644 --- a/src/main/java/net/minestom/server/item/ItemStackBuilder.java +++ b/src/main/java/net/minestom/server/item/ItemStackBuilder.java @@ -1,8 +1,8 @@ package net.minestom.server.item; -import com.google.common.annotations.Beta; import net.kyori.adventure.text.Component; import net.minestom.server.item.metadata.*; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -100,7 +100,7 @@ public class ItemStackBuilder { return this; } - @Beta + @ApiStatus.Experimental @Contract(value = "_ -> this") public @NotNull ItemStackBuilder stackingRule(@Nullable StackingRule stackingRule) { this.stackingRule = stackingRule; diff --git a/src/main/java/net/minestom/server/tag/TagHandler.java b/src/main/java/net/minestom/server/tag/TagHandler.java index b53db14a1..fa0d7042b 100644 --- a/src/main/java/net/minestom/server/tag/TagHandler.java +++ b/src/main/java/net/minestom/server/tag/TagHandler.java @@ -1,10 +1,10 @@ package net.minestom.server.tag; -import com.google.common.annotations.Beta; +import org.jetbrains.annotations.ApiStatus; /** * Represents an element which can read and write {@link Tag tags}. */ -@Beta +@ApiStatus.Experimental public interface TagHandler extends TagReadable, TagWritable { } diff --git a/src/main/java/net/minestom/server/utils/location/RelativeLocation.java b/src/main/java/net/minestom/server/utils/location/RelativeLocation.java index 259406877..b2c2135fc 100644 --- a/src/main/java/net/minestom/server/utils/location/RelativeLocation.java +++ b/src/main/java/net/minestom/server/utils/location/RelativeLocation.java @@ -1,8 +1,8 @@ package net.minestom.server.utils.location; -import com.google.common.annotations.Beta; import net.minestom.server.entity.Entity; import net.minestom.server.utils.Position; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,7 +31,7 @@ public abstract class RelativeLocation { */ public abstract T from(@Nullable Position position); - @Beta + @ApiStatus.Experimental public abstract T fromView(@Nullable Position position); /** @@ -45,7 +45,7 @@ public abstract class RelativeLocation { return from(entityPosition); } - @Beta + @ApiStatus.Experimental public T fromView(@Nullable Entity entity) { final Position entityPosition = entity != null ? entity.getPosition() : new Position(); return fromView(entityPosition);