Skip to content

Remove a bunch more experimental annotations #12712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.server.ServerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -19,10 +18,8 @@
* This is done at Plugin Enable time after commands have been registered, but may also
* run at a later point in the server lifetime due to plugins, a server reload, etc.</p>
*
* <p>This is a draft/experimental API and is subject to change.</p>
* @deprecated For removal, use the new brigadier api.
*/
@ApiStatus.Experimental
@Deprecated(since = "1.20.6")
@Warning(reason = "This event has been superseded by the Commands API and will be removed in a future release. Listen to LifecycleEvents.COMMANDS instead.", value = true)
public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
import java.util.Collections;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
* Implementing this interface allows for easily creating "Bukkit-style" {@code String[] args} commands.
* The implementation handles converting the command to a representation compatible with Brigadier on registration, usually in the form of {@literal /commandlabel <greedy_string>}.
*/
@ApiStatus.Experimental
@NullMarked
@FunctionalInterface
public interface BasicCommand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
Expand All @@ -21,8 +20,6 @@
* exist yet, or no specific sender is available. Methods on such a {@link CommandSender}
* will either have no effect or throw an {@link UnsupportedOperationException}.</p>
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface CommandSourceStack {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Set;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
Expand Down Expand Up @@ -58,8 +57,6 @@
*
* @see io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents#COMMANDS
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface Commands extends Registrar {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package io.papermc.paper.command.brigadier;

import com.mojang.brigadier.Message;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.ComponentSerializer;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* A component serializer for converting between {@link Message} and {@link Component}.
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface MessageComponentSerializer extends ComponentSerializer<Component, Component, Message> {

Expand All @@ -20,6 +19,10 @@ public interface MessageComponentSerializer extends ComponentSerializer<Componen
* @return serializer instance
*/
static MessageComponentSerializer message() {
return MessageComponentSerializerHolder.PROVIDER.orElseThrow();
final class Holder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class)
.findFirst();
}
return Holder.PROVIDER.orElseThrow();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvider.provider;

Expand All @@ -41,8 +39,6 @@
*
* <p>{@link CustomArgumentType} is provided for customizing parsing or result types server-side, while sending the vanilla argument type to the client.</p>
*/
@ApiStatus.Experimental
@NullMarked
public final class ArgumentTypes {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* An argument type that wraps around a native-to-vanilla argument type.
Expand All @@ -23,8 +22,6 @@
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
@NullMarked
public interface CustomArgumentType<T, N> extends ArgumentType<T> {

/**
Expand Down Expand Up @@ -107,7 +104,6 @@ default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
interface Converted<T, N> extends CustomArgumentType<T, N> {

@ApiStatus.NonExtendable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import org.jspecify.annotations.NullMarked;

/**
* Utilities for extracting registry-related arguments from a {@link CommandContext}.
*/
@NullMarked
public final class RegistryArgumentExtractor {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.chat.SignedMessage;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* A resolver for a {@link SignedMessage}
*
* @see ArgumentTypes#signedMessage()
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface SignedMessageResolver {

Expand All @@ -38,5 +35,4 @@ public interface SignedMessageResolver {
* @throws CommandSyntaxException syntax exception
*/
CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

@ApiStatus.Internal
@NullMarked
interface VanillaArgumentProvider {

Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Arguments.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemStackPredicate extends Predicate<ItemStack> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Predicates for argument types.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.predicate;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#doubleRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface DoubleRangeProvider extends RangeProvider<Double> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#integerRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface IntegerRangeProvider extends RangeProvider<Integer> {

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package io.papermc.paper.command.brigadier.argument.range;

import com.google.common.collect.Range;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* A provider for a range of numbers
*
* @param <T>
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Range providers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.range;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* An {@link ArgumentResolver} is capable of resolving
Expand All @@ -12,8 +11,6 @@
* @param <T> resolved type
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface ArgumentResolver<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition(boolean)
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface FinePositionResolver extends ArgumentResolver<FinePosition> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#playerProfiles()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerProfileListResolver extends ArgumentResolver<Collection<PlayerProfile>> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface RotationResolver extends ArgumentResolver<Rotation> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entity()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entities()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface EntitySelectorArgumentResolver extends SelectorArgumentResolver<List<Entity>> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#player()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#players()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerSelectorArgumentResolver extends SelectorArgumentResolver<List<Player>> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* @param <T> resolved type
* @see <a href="https://minecraft.wiki/w/Target_selectors">Target Selectors</a>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface SelectorArgumentResolver<T> extends ArgumentResolver<T> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Entity selector argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers.selector;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Brigadier connection API.
*/
@NullMarked
package io.papermc.paper.command.brigadier;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@NullMarked
@ApiStatus.NonExtendable
public interface DataComponentView {
// Paper start - data component API
/**
* Gets the value for the data component type on this stack.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* This class acts as an abstraction for a plugin configuration.
*/
@ApiStatus.Experimental // Subject to change!
@NullMarked
@ApiStatus.NonExtendable
public interface PluginMeta {
Expand Down Expand Up @@ -161,7 +160,6 @@ default String getDisplayName() {
*
* @return an immutable list of permissions
*/
// TODO: Do we even want this? Why not just use the bootstrapper
List<Permission> getPermissions();

/**
Expand All @@ -170,7 +168,6 @@ default String getDisplayName() {
* @return the bukkit permission default container.
* @see #getPermissions()
*/
// TODO: Do we even want this? Why not just use the bootstrapper
PermissionDefault getPermissionDefault();

/**
Expand Down
Loading
Loading