Replace google Beta annotation to jetbrains ApiStatus.Experimental

This commit is contained in:
TheMode 2021-06-20 21:48:07 +02:00
parent 1e9046d792
commit 4db3b9317d
11 changed files with 25 additions and 27 deletions

View File

@ -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<T> {
/**

View File

@ -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<E> implements Collection<Acquirable<E>> {
private final Collection<Acquirable<E>> acquirableCollection;

View File

@ -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<CommandSyntax> 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<String> getSyntaxesStrings() {
Set<String> 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()));

View File

@ -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<T> {
/**
* 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<T> {
* @param <O> The type of output expected.
* @return A new ArgumentMap that can get this complex object type.
*/
@Beta
@ApiStatus.Experimental
public <O> @NotNull ArgumentMap<T, O> map(@NotNull ArgumentMap.Mapper<T, O> mapper) {
return new ArgumentMap<>(this, mapper);
}

View File

@ -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<CommandResult> {
@ -69,7 +69,7 @@ public class ArgumentCommand extends Argument<CommandResult> {
return shortcut;
}
@Beta
@ApiStatus.Experimental
public ArgumentCommand setShortcut(@NotNull String shortcut) {
this.shortcut = shortcut;
return this;

View File

@ -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 {
* <p>
* 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);
}

View File

@ -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<Argument<?>> result = new ArrayList<>();

View File

@ -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<EntityEvent>, Da
return Objects.requireNonNullElse(this.customSynchronizationCooldown, SYNCHRONIZATION_COOLDOWN);
}
@Beta
@ApiStatus.Experimental
public <T extends Entity> @NotNull Acquirable<T> getAcquirable() {
return (Acquirable<T>) acquirable;
}
@Beta
@ApiStatus.Experimental
public <T extends Entity> @NotNull Acquirable<T> getAcquirable(@NotNull Class<T> clazz) {
return (Acquirable<T>) acquirable;
}

View File

@ -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;

View File

@ -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 {
}

View File

@ -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<T> {
*/
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<T> {
return from(entityPosition);
}
@Beta
@ApiStatus.Experimental
public T fromView(@Nullable Entity entity) {
final Position entityPosition = entity != null ? entity.getPosition() : new Position();
return fromView(entityPosition);