Remove a bunch more experimental annotations (#12712)

This commit is contained in:
Jake Potrebic
2025-06-28 07:32:44 -07:00
committed by Nassim Jahnke
parent 7f60924390
commit 371a422567
63 changed files with 81 additions and 159 deletions

View File

@@ -9,7 +9,6 @@ import org.bukkit.command.Command;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.server.ServerEvent; import org.bukkit.event.server.ServerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@@ -19,10 +18,8 @@ import org.jetbrains.annotations.NotNull;
* This is done at Plugin Enable time after commands have been registered, but may also * 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> * 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. * @deprecated For removal, use the new brigadier api.
*/ */
@ApiStatus.Experimental
@Deprecated(since = "1.20.6") @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) @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 { public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {

View File

@@ -4,15 +4,12 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable; import org.jspecify.annotations.Nullable;
/** /**
* Implementing this interface allows for easily creating "Bukkit-style" {@code String[] args} commands. * 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>}. * 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 @FunctionalInterface
public interface BasicCommand { public interface BasicCommand {

View File

@@ -6,7 +6,6 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable; import org.jspecify.annotations.Nullable;
/** /**
@@ -21,8 +20,6 @@ import org.jspecify.annotations.Nullable;
* exist yet, or no specific sender is available. Methods on such a {@link CommandSender} * 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> * will either have no effect or throw an {@link UnsupportedOperationException}.</p>
*/ */
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface CommandSourceStack { public interface CommandSourceStack {

View File

@@ -17,7 +17,6 @@ import java.util.Set;
import java.util.function.Predicate; import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable; import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable; import org.jspecify.annotations.Nullable;
/** /**
@@ -60,8 +59,6 @@ import org.jspecify.annotations.Nullable;
* *
* @see io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents#COMMANDS * @see io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents#COMMANDS
*/ */
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface Commands extends Registrar { public interface Commands extends Registrar {

View File

@@ -1,16 +1,15 @@
package io.papermc.paper.command.brigadier; package io.papermc.paper.command.brigadier;
import com.mojang.brigadier.Message; import com.mojang.brigadier.Message;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.ComponentSerializer; import net.kyori.adventure.text.serializer.ComponentSerializer;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/** /**
* A component serializer for converting between {@link Message} and {@link Component}. * A component serializer for converting between {@link Message} and {@link Component}.
*/ */
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface MessageComponentSerializer extends ComponentSerializer<Component, Component, Message> { public interface MessageComponentSerializer extends ComponentSerializer<Component, Component, Message> {
@@ -20,6 +19,10 @@ public interface MessageComponentSerializer extends ComponentSerializer<Componen
* @return serializer instance * @return serializer instance
*/ */
static MessageComponentSerializer message() { static MessageComponentSerializer message() {
return MessageComponentSerializerHolder.PROVIDER.orElseThrow(); final class Holder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class)
.findFirst();
}
return Holder.PROVIDER.orElseThrow();
} }
} }

View File

@@ -1,12 +0,0 @@
package io.papermc.paper.command.brigadier;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
final class MessageComponentSerializerHolder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class)
.findFirst();
}

View File

@@ -28,8 +28,6 @@ import org.bukkit.block.structure.StructureRotation;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria; import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot; 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; import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvider.provider;
@@ -41,8 +39,6 @@ import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvide
* *
* <p>{@link CustomArgumentType} is provided for customizing parsing or result types server-side, while sending the vanilla argument type to the client.</p> * <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 { public final class ArgumentTypes {
/** /**

View File

@@ -9,7 +9,6 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import java.util.Collection; import java.util.Collection;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/** /**
* An argument type that wraps around a native-to-vanilla argument type. * An argument type that wraps around a native-to-vanilla argument type.
@@ -23,8 +22,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> custom type * @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes}) * @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/ */
@ApiStatus.Experimental
@NullMarked
public interface CustomArgumentType<T, N> extends ArgumentType<T> { public interface CustomArgumentType<T, N> extends ArgumentType<T> {
/** /**
@@ -107,7 +104,6 @@ public interface CustomArgumentType<T, N> extends ArgumentType<T> {
* @param <T> custom type * @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes}) * @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/ */
@ApiStatus.Experimental
interface Converted<T, N> extends CustomArgumentType<T, N> { interface Converted<T, N> extends CustomArgumentType<T, N> {
@ApiStatus.NonExtendable @ApiStatus.NonExtendable

View File

@@ -3,12 +3,10 @@ package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import org.jspecify.annotations.NullMarked;
/** /**
* Utilities for extracting registry-related arguments from a {@link CommandContext}. * Utilities for extracting registry-related arguments from a {@link CommandContext}.
*/ */
@NullMarked
public final class RegistryArgumentExtractor { public final class RegistryArgumentExtractor {
/** /**

View File

@@ -6,15 +6,12 @@ import io.papermc.paper.command.brigadier.CommandSourceStack;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.chat.SignedMessage; import net.kyori.adventure.chat.SignedMessage;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/** /**
* A resolver for a {@link SignedMessage} * A resolver for a {@link SignedMessage}
* *
* @see ArgumentTypes#signedMessage() * @see ArgumentTypes#signedMessage()
*/ */
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface SignedMessageResolver { public interface SignedMessageResolver {
@@ -38,5 +35,4 @@ public interface SignedMessageResolver {
* @throws CommandSyntaxException syntax exception * @throws CommandSyntaxException syntax exception
*/ */
CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException; CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException;
} }

View File

@@ -31,10 +31,8 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria; import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal @ApiStatus.Internal
@NullMarked
interface VanillaArgumentProvider { interface VanillaArgumentProvider {
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class) Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class)

View File

@@ -0,0 +1,7 @@
/**
* Arguments.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument;
import org.jspecify.annotations.NullMarked;

View File

@@ -9,7 +9,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface ItemStackPredicate extends Predicate<ItemStack> { public interface ItemStackPredicate extends Predicate<ItemStack> {
} }

View File

@@ -0,0 +1,7 @@
/**
* Predicates for argument types.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.predicate;
import org.jspecify.annotations.NullMarked;

View File

@@ -7,8 +7,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#doubleRange() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#doubleRange()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public non-sealed interface DoubleRangeProvider extends RangeProvider<Double> { public non-sealed interface DoubleRangeProvider extends RangeProvider<Double> {
} }

View File

@@ -7,8 +7,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#integerRange() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#integerRange()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public non-sealed interface IntegerRangeProvider extends RangeProvider<Integer> { public non-sealed interface IntegerRangeProvider extends RangeProvider<Integer> {
} }

View File

@@ -1,8 +1,6 @@
package io.papermc.paper.command.brigadier.argument.range; package io.papermc.paper.command.brigadier.argument.range;
import com.google.common.collect.Range; import com.google.common.collect.Range;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/** /**
* A provider for a range of numbers * A provider for a range of numbers
@@ -10,8 +8,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> * @param <T>
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/ */
@ApiStatus.Experimental
@NullMarked
public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider { public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider {
/** /**

View File

@@ -0,0 +1,7 @@
/**
* Range providers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.range;
import org.jspecify.annotations.NullMarked;

View File

@@ -3,7 +3,6 @@ package io.papermc.paper.command.brigadier.argument.resolvers;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.command.brigadier.CommandSourceStack; import io.papermc.paper.command.brigadier.CommandSourceStack;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/** /**
* An {@link ArgumentResolver} is capable of resolving * An {@link ArgumentResolver} is capable of resolving
@@ -12,8 +11,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> resolved type * @param <T> resolved type
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/ */
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface ArgumentResolver<T> { public interface ArgumentResolver<T> {

View File

@@ -10,7 +10,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> { public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> {
} }

View File

@@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition(boolean) * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition(boolean)
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface FinePositionResolver extends ArgumentResolver<FinePosition> { public interface FinePositionResolver extends ArgumentResolver<FinePosition> {
} }

View File

@@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#playerProfiles() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#playerProfiles()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface PlayerProfileListResolver extends ArgumentResolver<Collection<PlayerProfile>> { public interface PlayerProfileListResolver extends ArgumentResolver<Collection<PlayerProfile>> {
} }

View File

@@ -10,7 +10,6 @@ import org.jetbrains.annotations.ApiStatus;
* *
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface RotationResolver extends ArgumentResolver<Rotation> { public interface RotationResolver extends ArgumentResolver<Rotation> {
} }

View File

@@ -0,0 +1,7 @@
/**
* Argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers;
import org.jspecify.annotations.NullMarked;

View File

@@ -13,7 +13,6 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entity() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entity()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entities() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entities()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface EntitySelectorArgumentResolver extends SelectorArgumentResolver<List<Entity>> { public interface EntitySelectorArgumentResolver extends SelectorArgumentResolver<List<Entity>> {
} }

View File

@@ -13,7 +13,6 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#player() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#player()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#players() * @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#players()
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface PlayerSelectorArgumentResolver extends SelectorArgumentResolver<List<Player>> { public interface PlayerSelectorArgumentResolver extends SelectorArgumentResolver<List<Player>> {
} }

View File

@@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> resolved type * @param <T> resolved type
* @see <a href="https://minecraft.wiki/w/Target_selectors">Target Selectors</a> * @see <a href="https://minecraft.wiki/w/Target_selectors">Target Selectors</a>
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface SelectorArgumentResolver<T> extends ArgumentResolver<T> { public interface SelectorArgumentResolver<T> extends ArgumentResolver<T> {
} }

View File

@@ -0,0 +1,7 @@
/**
* Entity selector argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers.selector;
import org.jspecify.annotations.NullMarked;

View File

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

View File

@@ -15,7 +15,6 @@ import org.jspecify.annotations.Nullable;
@NullMarked @NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface DataComponentView { public interface DataComponentView {
// Paper start - data component API
/** /**
* Gets the value for the data component type on this stack. * Gets the value for the data component type on this stack.
* *

View File

@@ -12,7 +12,6 @@ import org.jspecify.annotations.Nullable;
/** /**
* This class acts as an abstraction for a plugin configuration. * This class acts as an abstraction for a plugin configuration.
*/ */
@ApiStatus.Experimental // Subject to change!
@NullMarked @NullMarked
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface PluginMeta { public interface PluginMeta {
@@ -161,7 +160,6 @@ public interface PluginMeta {
* *
* @return an immutable list of permissions * @return an immutable list of permissions
*/ */
// TODO: Do we even want this? Why not just use the bootstrapper
List<Permission> getPermissions(); List<Permission> getPermissions();
/** /**
@@ -170,7 +168,6 @@ public interface PluginMeta {
* @return the bukkit permission default container. * @return the bukkit permission default container.
* @see #getPermissions() * @see #getPermissions()
*/ */
// TODO: Do we even want this? Why not just use the bootstrapper
PermissionDefault getPermissionDefault(); PermissionDefault getPermissionDefault();
/** /**

View File

@@ -1,6 +1,4 @@
@ApiStatus.Experimental
@NullMarked @NullMarked
package io.papermc.paper.plugin.lifecycle.event.handler.configuration; package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;

View File

@@ -1,6 +1,4 @@
@ApiStatus.Experimental
@NullMarked @NullMarked
package io.papermc.paper.plugin.lifecycle.event.handler; package io.papermc.paper.plugin.lifecycle.event.handler;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;

View File

@@ -1,6 +1,4 @@
@ApiStatus.Experimental
@NullMarked @NullMarked
package io.papermc.paper.plugin.lifecycle.event; package io.papermc.paper.plugin.lifecycle.event;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;

View File

@@ -1,6 +1,4 @@
@ApiStatus.Experimental
@NullMarked @NullMarked
package io.papermc.paper.plugin.lifecycle.event.registrar; package io.papermc.paper.plugin.lifecycle.event.registrar;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;

View File

@@ -29,6 +29,7 @@ public final class LifecycleEvents {
* These events are for registering tags to the server's tag system. You can register a handler for these events * These events are for registering tags to the server's tag system. You can register a handler for these events
* only in {@link io.papermc.paper.plugin.bootstrap.PluginBootstrap#bootstrap(BootstrapContext)}. * only in {@link io.papermc.paper.plugin.bootstrap.PluginBootstrap#bootstrap(BootstrapContext)}.
*/ */
@ApiStatus.Experimental
public static final TagEventTypeProvider TAGS = LifecycleEventTypeProvider.provider().tagProvider(); public static final TagEventTypeProvider TAGS = LifecycleEventTypeProvider.provider().tagProvider();
@@ -37,6 +38,7 @@ public final class LifecycleEvents {
* can register a handler for this event only in {@link io.papermc.paper.plugin.bootstrap.PluginBootstrap#bootstrap(BootstrapContext)}. * can register a handler for this event only in {@link io.papermc.paper.plugin.bootstrap.PluginBootstrap#bootstrap(BootstrapContext)}.
* @see DatapackRegistrar an example of a datapack being discovered * @see DatapackRegistrar an example of a datapack being discovered
*/ */
@ApiStatus.Experimental
public static final LifecycleEventType.Prioritizable<BootstrapContext, RegistrarEvent<DatapackRegistrar>> DATAPACK_DISCOVERY = bootstrapPrioritized("datapack_discovery"); public static final LifecycleEventType.Prioritizable<BootstrapContext, RegistrarEvent<DatapackRegistrar>> DATAPACK_DISCOVERY = bootstrapPrioritized("datapack_discovery");
//<editor-fold desc="helper methods" defaultstate="collapsed"> //<editor-fold desc="helper methods" defaultstate="collapsed">

View File

@@ -1,6 +1,4 @@
@ApiStatus.Experimental
@NullMarked @NullMarked
package io.papermc.paper.plugin.lifecycle.event.types; package io.papermc.paper.plugin.lifecycle.event.types;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;

View File

@@ -36,7 +36,6 @@ import org.bukkit.inventory.meta.trim.TrimPattern;
import org.bukkit.map.MapCursor; import org.bukkit.map.MapCursor;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType; import org.bukkit.potion.PotionType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
import static io.papermc.paper.registry.RegistryKeyImpl.create; import static io.papermc.paper.registry.RegistryKeyImpl.create;
@@ -253,7 +252,6 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the key of the typed key. * @param key the key of the typed key.
* @return the constructed tag key. * @return the constructed tag key.
*/ */
@ApiStatus.Experimental
default TagKey<T> tagKey(final Key key) { default TagKey<T> tagKey(final Key key) {
return TagKey.create(this, key); return TagKey.create(this, key);
} }
@@ -264,7 +262,6 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the string representation of the key that will be passed to {@link Key#key(String)}. * @param key the string representation of the key that will be passed to {@link Key#key(String)}.
* @return the constructed tag key. * @return the constructed tag key.
*/ */
@ApiStatus.Experimental
default TagKey<T> tagKey(@KeyPattern final String key) { default TagKey<T> tagKey(@KeyPattern final String key) {
return TagKey.create(this, key); return TagKey.create(this, key);
} }

View File

@@ -14,7 +14,6 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> registry entry type * @param <T> registry entry type
* @param <B> registry entry builder type * @param <B> registry entry builder type
*/ */
@ApiStatus.Experimental
@ApiStatus.NonExtendable @ApiStatus.NonExtendable
public interface RegistryComposeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> { public interface RegistryComposeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {

View File

@@ -1,15 +1,12 @@
package io.papermc.paper.registry.tag; package io.papermc.paper.registry.tag;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern; import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.key.Keyed; import net.kyori.adventure.key.Keyed;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
@ApiStatus.Experimental
@NullMarked @NullMarked
public sealed interface TagKey<T> extends Keyed permits TagKeyImpl { public sealed interface TagKey<T> extends Keyed permits TagKeyImpl {
@@ -35,7 +32,6 @@ public sealed interface TagKey<T> extends Keyed permits TagKeyImpl {
* @return a new tag key * @return a new tag key
* @see Key#key(String) * @see Key#key(String)
*/ */
@ApiStatus.Experimental
static <T> TagKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) { static <T> TagKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) {
return create(registryKey, Key.key(key)); return create(registryKey, Key.key(key));
} }

View File

@@ -1,12 +1,10 @@
package org.bukkit; package org.bukkit;
// Paper start - overhaul FeatureFlag API
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import java.util.List; import java.util.List;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.kyori.adventure.util.Index; import net.kyori.adventure.util.Index;
import org.intellij.lang.annotations.Subst; import org.intellij.lang.annotations.Subst;
// Paper end - overhaul FeatureFlag API
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
/** /**
@@ -75,6 +73,5 @@ public interface FeatureFlag extends Keyed {
private static FeatureFlag deprecated(@Subst("vanilla") final String name) { private static FeatureFlag deprecated(@Subst("vanilla") final String name) {
return new FeatureFlagImpl.Deprecated(NamespacedKey.minecraft(name)); return new FeatureFlagImpl.Deprecated(NamespacedKey.minecraft(name));
} }
// Paper end - overhaul FeatureFlag API
} }

View File

@@ -1,11 +1,8 @@
package org.bukkit; package org.bukkit;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a movement input applied to an entity. * Represents a movement input applied to an entity.
*/ */
@ApiStatus.Experimental
public interface Input { public interface Input {
/** /**

View File

@@ -2,13 +2,12 @@ package org.bukkit;
import io.papermc.paper.registry.RegistryAccess; import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked;
import org.jetbrains.annotations.NotNull;
/** /**
* Represents a song which may play in a Jukebox. * Represents a song which may play in a Jukebox.
*/ */
@ApiStatus.Experimental @NullMarked
public interface JukeboxSong extends Keyed, Translatable { public interface JukeboxSong extends Keyed, Translatable {
// Start generate - JukeboxSong // Start generate - JukeboxSong
@@ -56,18 +55,15 @@ public interface JukeboxSong extends Keyed, Translatable {
JukeboxSong WARD = get("ward"); JukeboxSong WARD = get("ward");
// End generate - JukeboxSong // End generate - JukeboxSong
@NotNull private static JukeboxSong get(String key) {
private static JukeboxSong get(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.JUKEBOX_SONG).getOrThrow(NamespacedKey.minecraft(key)); return RegistryAccess.registryAccess().getRegistry(RegistryKey.JUKEBOX_SONG).getOrThrow(NamespacedKey.minecraft(key));
} }
// Paper start - adventure
/** /**
* @deprecated this method assumes that jukebox song description will * @deprecated this method assumes that jukebox song description will
* always be a translatable component which is not guaranteed. * always be a translatable component which is not guaranteed.
*/ */
@Override @Override
@Deprecated(forRemoval = true) @Deprecated(forRemoval = true)
@org.jetbrains.annotations.NotNull String getTranslationKey(); String getTranslationKey();
// Paper end - adventure
} }

View File

@@ -3577,9 +3577,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
* Tries to convert this Material to an item type * Tries to convert this Material to an item type
* *
* @return the converted item type or null * @return the converted item type or null
* @apiNote only for internal use
*/ */
@ApiStatus.Internal
@Nullable @Nullable
@org.jetbrains.annotations.Contract(pure = true) // Paper @org.jetbrains.annotations.Contract(pure = true) // Paper
public ItemType asItemType() { public ItemType asItemType() {
@@ -3590,9 +3588,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
* Tries to convert this Material to a block type * Tries to convert this Material to a block type
* *
* @return the converted block type or null * @return the converted block type or null
* @apiNote only for internal use
*/ */
@ApiStatus.Internal
@Nullable @Nullable
@org.jetbrains.annotations.Contract(pure = true) // Paper @org.jetbrains.annotations.Contract(pure = true) // Paper
public BlockType asBlockType() { public BlockType asBlockType() {

View File

@@ -122,7 +122,6 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* *
* @see BlockType * @see BlockType
*/ */
@ApiStatus.Experimental
Registry<BlockType> BLOCK = registryFor(RegistryKey.BLOCK); Registry<BlockType> BLOCK = registryFor(RegistryKey.BLOCK);
/** /**
* Custom boss bars. * Custom boss bars.
@@ -179,7 +178,6 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* *
* @see ItemType * @see ItemType
*/ */
@ApiStatus.Experimental
Registry<ItemType> ITEM = registryFor(RegistryKey.ITEM); Registry<ItemType> ITEM = registryFor(RegistryKey.ITEM);
/** /**
* Default server loot tables. * Default server loot tables.
@@ -480,7 +478,6 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @throws UnsupportedOperationException if this registry doesn't have or support tags * @throws UnsupportedOperationException if this registry doesn't have or support tags
* @see #getTag(TagKey) * @see #getTag(TagKey)
*/ */
@ApiStatus.Experimental
boolean hasTag(TagKey<T> key); boolean hasTag(TagKey<T> key);
/** /**
@@ -507,8 +504,8 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see Tag#resolve(Registry) * @see Tag#resolve(Registry)
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
default Collection<T> getTagValues(TagKey<T> key) { default Collection<T> getTagValues(final TagKey<T> key) {
Tag<T> tag = getTag(key); Tag<T> tag = this.getTag(key);
return tag.resolve(this); return tag.resolve(this);
} }

View File

@@ -60,7 +60,6 @@ public interface BlockState extends Metadatable {
* @return a copy of the block state * @return a copy of the block state
*/ */
@NotNull @NotNull
@ApiStatus.Experimental
BlockState copy(); BlockState copy();
/** /**
@@ -70,7 +69,6 @@ public interface BlockState extends Metadatable {
* @return the new block state * @return the new block state
*/ */
@NotNull @NotNull
@ApiStatus.Experimental
BlockState copy(@NotNull Location location); BlockState copy(@NotNull Location location);
/** /**

View File

@@ -4,6 +4,7 @@ import java.util.Collection;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.spawner.TrialSpawnerConfiguration; import org.bukkit.spawner.TrialSpawnerConfiguration;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -185,6 +186,7 @@ public interface TrialSpawner extends TileState {
* *
* @return the TrialSpawnerConfiguration * @return the TrialSpawnerConfiguration
*/ */
@ApiStatus.Experimental
TrialSpawnerConfiguration getNormalConfiguration(); TrialSpawnerConfiguration getNormalConfiguration();
/** /**
@@ -193,5 +195,6 @@ public interface TrialSpawner extends TileState {
* *
* @return the TrialSpawnerConfiguration * @return the TrialSpawnerConfiguration
*/ */
@ApiStatus.Experimental
TrialSpawnerConfiguration getOminousConfiguration(); TrialSpawnerConfiguration getOminousConfiguration();
} }

View File

@@ -277,7 +277,6 @@ public interface BlockData extends Cloneable {
* @return a new {@link BlockState} * @return a new {@link BlockState}
*/ */
@NotNull @NotNull
@ApiStatus.Experimental
BlockState createBlockState(); BlockState createBlockState();
// Paper start - destroy speed API // Paper start - destroy speed API

View File

@@ -10,7 +10,6 @@ import org.jetbrains.annotations.NotNull;
* Represents a type of effect that occurs when damage is inflicted. Currently, * Represents a type of effect that occurs when damage is inflicted. Currently,
* effects only determine the sound that plays. * effects only determine the sound that plays.
*/ */
@ApiStatus.Experimental
public interface DamageEffect { public interface DamageEffect {
/** /**

View File

@@ -1,12 +1,10 @@
package org.bukkit.damage; package org.bukkit.damage;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.jetbrains.annotations.ApiStatus;
/** /**
* A means of damage scaling with respect to the server's difficulty. * A means of damage scaling with respect to the server's difficulty.
*/ */
@ApiStatus.Experimental
public enum DamageScaling { public enum DamageScaling {
/** /**

View File

@@ -3,14 +3,12 @@ package org.bukkit.damage;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
/** /**
* Represents a source of damage. * Represents a source of damage.
*/ */
@ApiStatus.Experimental
public interface DamageSource { public interface DamageSource {
/** /**

View File

@@ -4,9 +4,7 @@ import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed; import org.bukkit.Keyed;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.Translatable; import org.bukkit.Translatable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@@ -18,7 +16,6 @@ import org.jetbrains.annotations.NotNull;
* *
* @see <a href="https://minecraft.wiki/w/Damage_type">Minecraft Wiki</a> * @see <a href="https://minecraft.wiki/w/Damage_type">Minecraft Wiki</a>
*/ */
@ApiStatus.Experimental
public interface DamageType extends Keyed, Translatable { public interface DamageType extends Keyed, Translatable {
// Start generate - DamageType // Start generate - DamageType

View File

@@ -1,11 +1,8 @@
package org.bukkit.damage; package org.bukkit.damage;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a type of death message used by a {@link DamageSource}. * Represents a type of death message used by a {@link DamageSource}.
*/ */
@ApiStatus.Experimental
public enum DeathMessageType { public enum DeathMessageType {
/** /**

View File

@@ -1,5 +1,7 @@
/** /**
* Classes concerning damage types and sources applicable to living entities. * Classes concerning damage types and sources applicable to living entities.
*/ */
@org.jetbrains.annotations.ApiStatus.Experimental @ApiStatus.Experimental
package org.bukkit.damage; package org.bukkit.damage;
import org.jetbrains.annotations.ApiStatus;

View File

@@ -1,12 +1,11 @@
package org.bukkit.entity; package org.bukkit.entity;
import java.util.List;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable; import org.jetbrains.annotations.Unmodifiable;
import java.util.List;
/** /**
* Represents an arrow. * Represents an arrow.
@@ -157,7 +156,6 @@ public interface AbstractArrow extends Projectile {
* @deprecated use {@link #getItemStack()} * @deprecated use {@link #getItemStack()}
*/ */
@NotNull @NotNull
@ApiStatus.Experimental
@Deprecated(forRemoval = true, since = "1.20.4") // Paper @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public ItemStack getItem(); public ItemStack getItem();
@@ -167,7 +165,6 @@ public interface AbstractArrow extends Projectile {
* @param item ItemStack set to be picked up * @param item ItemStack set to be picked up
* @deprecated use {@link #setItemStack(ItemStack)} * @deprecated use {@link #setItemStack(ItemStack)}
*/ */
@ApiStatus.Experimental
@Deprecated(forRemoval = true, since = "1.20.4") // Paper @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public void setItem(@NotNull ItemStack item); public void setItem(@NotNull ItemStack item);
@@ -177,7 +174,6 @@ public interface AbstractArrow extends Projectile {
* @return The firing ItemStack * @return The firing ItemStack
*/ */
@Nullable // Paper @Nullable // Paper
@ApiStatus.Experimental
public ItemStack getWeapon(); public ItemStack getWeapon();
/** /**
@@ -185,7 +181,6 @@ public interface AbstractArrow extends Projectile {
* *
* @param item The firing ItemStack * @param item The firing ItemStack
*/ */
@ApiStatus.Experimental
public void setWeapon(@NotNull ItemStack item); public void setWeapon(@NotNull ItemStack item);
/** /**

View File

@@ -621,7 +621,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* *
* @return current input * @return current input
*/ */
@ApiStatus.Experimental
public Input getCurrentInput(); public Input getCurrentInput();
/** /**
@@ -1251,7 +1250,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if location is null * @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if tileState is null * @throws IllegalArgumentException if tileState is null
*/ */
@ApiStatus.Experimental
public void sendBlockUpdate(Location loc, TileState tileState) throws IllegalArgumentException; public void sendBlockUpdate(Location loc, TileState tileState) throws IllegalArgumentException;
/** /**

View File

@@ -20,7 +20,6 @@ import org.jetbrains.annotations.Nullable;
* Example: A player unlocks a trial chamber vault and the vault block dispenses * Example: A player unlocks a trial chamber vault and the vault block dispenses
* its loot. * its loot.
*/ */
@ApiStatus.Experimental
public class BlockDispenseLootEvent extends BlockEvent implements Cancellable { public class BlockDispenseLootEvent extends BlockEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList(); private static final HandlerList HANDLER_LIST = new HandlerList();

View File

@@ -11,7 +11,6 @@ import org.jetbrains.annotations.Nullable;
/** /**
* Called when a vault in a trial chamber is about to display an item. * Called when a vault in a trial chamber is about to display an item.
*/ */
@ApiStatus.Experimental
public class VaultDisplayItemEvent extends BlockEvent implements Cancellable { public class VaultDisplayItemEvent extends BlockEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList(); private static final HandlerList HANDLER_LIST = new HandlerList();

View File

@@ -11,7 +11,6 @@ import org.jetbrains.annotations.NotNull;
* *
* @see Player#getCurrentInput() * @see Player#getCurrentInput()
*/ */
@ApiStatus.Experimental
public class PlayerInputEvent extends PlayerEvent { public class PlayerInputEvent extends PlayerEvent {
private static final HandlerList HANDLER_LIST = new HandlerList(); private static final HandlerList HANDLER_LIST = new HandlerList();

View File

@@ -12,7 +12,6 @@ import org.jetbrains.annotations.Nullable;
/** /**
* Represents a group of {@link EquipmentSlot}. * Represents a group of {@link EquipmentSlot}.
*/ */
@ApiStatus.Experimental
public final class EquipmentSlotGroup implements Predicate<EquipmentSlot> { public final class EquipmentSlotGroup implements Predicate<EquipmentSlot> {
private static final Map<String, EquipmentSlotGroup> BY_NAME = new HashMap<>(); private static final Map<String, EquipmentSlotGroup> BY_NAME = new HashMap<>();

View File

@@ -372,7 +372,6 @@ public abstract class JavaPlugin extends PluginBase {
* @param basicCommand the basic command instance to register * @param basicCommand the basic command instance to register
* @see LifecycleEvents#COMMANDS * @see LifecycleEvents#COMMANDS
*/ */
@ApiStatus.Experimental
public void registerCommand(final String label, final BasicCommand basicCommand) { public void registerCommand(final String label, final BasicCommand basicCommand) {
this.registerCommand(label, null, Collections.emptyList(), basicCommand); this.registerCommand(label, null, Collections.emptyList(), basicCommand);
} }
@@ -392,7 +391,6 @@ public abstract class JavaPlugin extends PluginBase {
* @param basicCommand the basic command instance to register * @param basicCommand the basic command instance to register
* @see LifecycleEvents#COMMANDS * @see LifecycleEvents#COMMANDS
*/ */
@ApiStatus.Experimental
public void registerCommand(final String label, final @Nullable String description, final BasicCommand basicCommand) { public void registerCommand(final String label, final @Nullable String description, final BasicCommand basicCommand) {
this.registerCommand(label, description, Collections.emptyList(), basicCommand); this.registerCommand(label, description, Collections.emptyList(), basicCommand);
} }
@@ -412,7 +410,6 @@ public abstract class JavaPlugin extends PluginBase {
* @param basicCommand the basic command instance to register * @param basicCommand the basic command instance to register
* @see LifecycleEvents#COMMANDS * @see LifecycleEvents#COMMANDS
*/ */
@ApiStatus.Experimental
public void registerCommand(final String label, final Collection<String> aliases, final BasicCommand basicCommand) { public void registerCommand(final String label, final Collection<String> aliases, final BasicCommand basicCommand) {
this.registerCommand(label, null, aliases, basicCommand); this.registerCommand(label, null, aliases, basicCommand);
} }
@@ -433,7 +430,6 @@ public abstract class JavaPlugin extends PluginBase {
* @param basicCommand the basic command instance to register * @param basicCommand the basic command instance to register
* @see LifecycleEvents#COMMANDS * @see LifecycleEvents#COMMANDS
*/ */
@ApiStatus.Experimental
public void registerCommand(final String label, final @Nullable String description, final Collection<String> aliases, final BasicCommand basicCommand) { public void registerCommand(final String label, final @Nullable String description, final Collection<String> aliases, final BasicCommand basicCommand) {
this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> { this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
event.registrar().register(label, description, aliases, basicCommand); event.registrar().register(label, description, aliases, basicCommand);

View File

@@ -3,11 +3,12 @@ package org.bukkit.spawner;
import java.util.Map; import java.util.Map;
import org.bukkit.loot.LootTable; import org.bukkit.loot.LootTable;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NullMarked;
/** /**
* Represents one of the configurations of a trial spawner. * Represents one of the configurations of a trial spawner.
*/ */
@NullMarked
@ApiStatus.Experimental @ApiStatus.Experimental
public interface TrialSpawnerConfiguration extends BaseSpawner { public interface TrialSpawnerConfiguration extends BaseSpawner {
@@ -17,7 +18,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @return the number of entities * @return the number of entities
*/ */
public float getBaseSpawnsBeforeCooldown(); float getBaseSpawnsBeforeCooldown();
/** /**
* Sets the base number of entities the spawner will spawn before going into * Sets the base number of entities the spawner will spawn before going into
@@ -25,7 +26,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @param amount the number of entities * @param amount the number of entities
*/ */
public void setBaseSpawnsBeforeCooldown(float amount); void setBaseSpawnsBeforeCooldown(float amount);
/** /**
* Gets the base number of entities this spawner can track at once. <br> * Gets the base number of entities this spawner can track at once. <br>
@@ -34,7 +35,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @return the number of entities * @return the number of entities
*/ */
public float getBaseSimultaneousEntities(); float getBaseSimultaneousEntities();
/** /**
* Sets the base number of entities this spawner can track at once. <br> * Sets the base number of entities this spawner can track at once. <br>
@@ -43,7 +44,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @param amount the number of entities * @param amount the number of entities
*/ */
public void setBaseSimultaneousEntities(float amount); void setBaseSimultaneousEntities(float amount);
/** /**
* Gets the additional number of entities the spawner will spawn per tracked player * Gets the additional number of entities the spawner will spawn per tracked player
@@ -51,7 +52,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @return the number of entities * @return the number of entities
*/ */
public float getAdditionalSpawnsBeforeCooldown(); float getAdditionalSpawnsBeforeCooldown();
/** /**
* Sets the additional number of entities the spawner will spawn per tracked player * Sets the additional number of entities the spawner will spawn per tracked player
@@ -59,7 +60,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @param amount the number of entities * @param amount the number of entities
*/ */
public void setAdditionalSpawnsBeforeCooldown(float amount); void setAdditionalSpawnsBeforeCooldown(float amount);
/** /**
* Gets the additional number of entities this spawner can track at once per * Gets the additional number of entities this spawner can track at once per
@@ -69,7 +70,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @return the number of entities * @return the number of entities
*/ */
public float getAdditionalSimultaneousEntities(); float getAdditionalSimultaneousEntities();
/** /**
* Sets the additional number of entities this spawner can track at once per * Sets the additional number of entities this spawner can track at once per
@@ -79,26 +80,25 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @param amount the number of entities * @param amount the number of entities
*/ */
public void setAdditionalSimultaneousEntities(float amount); void setAdditionalSimultaneousEntities(float amount);
/** /**
* Gets a list of {@link LootTable}s this spawner can pick a reward from as * Gets a list of {@link LootTable}s this spawner can pick a reward from as
* well as their associated weight to be chosen. * well as their associated weight to be chosen.
* *
* @return a map of loot tables and their associated weight, or an empty * @return a map of loot tables and their associated weight, or an empty
* map if there are none * map if there are none
*/ */
@NotNull Map<LootTable, Integer> getPossibleRewards();
public Map<LootTable, Integer> getPossibleRewards();
/** /**
* Add a {@link LootTable} to the list of tables this spawner can pick a reward * Add a {@link LootTable} to the list of tables this spawner can pick a reward
* from with a given weight. * from with a given weight.
* *
* @param table the loot table * @param table the loot table
* @param weight the weight, must be at least 1 * @param weight the weight, must be at least 1
*/ */
public void addPossibleReward(@NotNull LootTable table, int weight); void addPossibleReward(LootTable table, int weight);
/** /**
* Removes the provided {@link LootTable} from the list of tables this spawner * Removes the provided {@link LootTable} from the list of tables this spawner
@@ -106,7 +106,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* *
* @param table the loot table * @param table the loot table
*/ */
public void removePossibleReward(@NotNull LootTable table); void removePossibleReward(LootTable table);
/** /**
* Sets the list of {@link LootTable}s and their weights this spawner can pick a * Sets the list of {@link LootTable}s and their weights this spawner can pick a
@@ -115,7 +115,7 @@ public interface TrialSpawnerConfiguration extends BaseSpawner {
* 1. * 1.
* *
* @param rewards a map of loot tables and their weights, or null to clear all * @param rewards a map of loot tables and their weights, or null to clear all
* possible tables * possible tables
*/ */
public void setPossibleRewards(@NotNull Map<LootTable, Integer> rewards); void setPossibleRewards(Map<LootTable, Integer> rewards);
} }

View File

@@ -48,7 +48,6 @@ public class GeneratedTagKeyType extends SimpleGenerator {
.addCode("return $T.create($T.$L, $N);", TagKey.class, RegistryKey.class, this.entry.registryKeyField(), keyParam) .addCode("return $T.create($T.$L, $N);", TagKey.class, RegistryKey.class, this.entry.registryKeyField(), keyParam)
.returns(returnType); .returns(returnType);
if (publicCreateKeyMethod) { if (publicCreateKeyMethod) {
create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental
create.addJavadoc(Javadocs.CREATED_TAG_KEY_JAVADOC, this.entry.apiClass(), this.entry.registryKey().location().toString()); create.addJavadoc(Javadocs.CREATED_TAG_KEY_JAVADOC, this.entry.apiClass(), this.entry.registryKey().location().toString());
} }
return create; return create;
@@ -90,8 +89,6 @@ public class GeneratedTagKeyType extends SimpleGenerator {
if (allExperimental.get()) { if (allExperimental.get()) {
typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION);
createMethod.addAnnotation(EXPERIMENTAL_API_ANNOTATION); createMethod.addAnnotation(EXPERIMENTAL_API_ANNOTATION);
} else {
typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API
} }
return typeBuilder.addMethod(createMethod.build()).build(); return typeBuilder.addMethod(createMethod.build()).build();
} }