Skip to content
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
12 changes: 12 additions & 0 deletions paper-api/src/main/java/org/bukkit/Bukkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,10 @@ public static Logger getLogger() {
*
* @param name the name of the command to retrieve
* @return a plugin command if found, null otherwise
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@Nullable
public static PluginCommand getPluginCommand(@NotNull String name) {
return server.getPluginCommand(name);
Expand Down Expand Up @@ -1348,7 +1351,10 @@ public static boolean removeRecipe(@NotNull NamespacedKey key, boolean resendRec
* Gets a list of command aliases defined in the server properties.
*
* @return a map of aliases to command names
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@NotNull
public static Map<String, String[]> getCommandAliases() {
return server.getCommandAliases();
Expand Down Expand Up @@ -2658,7 +2664,10 @@ public static UnsafeValues getUnsafe() {
* Gets the active {@link org.bukkit.command.CommandMap}
*
* @return the active command map
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@NotNull
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
Expand All @@ -2675,7 +2684,10 @@ public static void reloadPermissions() {
* Reload the Command Aliases in commands.yml
*
* @return Whether the reload was successful
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public static boolean reloadCommandAliases() {
return server.reloadCommandAliases();
}
Expand Down
14 changes: 14 additions & 0 deletions paper-api/src/main/java/org/bukkit/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,10 @@ default ItemStack createExplorerMap(@NotNull World world, @NotNull Location loca
*
* @param name the name of the command to retrieve
* @return a plugin command if found, null otherwise
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@Nullable
public PluginCommand getPluginCommand(@NotNull String name);

Expand Down Expand Up @@ -1239,7 +1242,10 @@ default boolean removeRecipe(@NotNull NamespacedKey key) {
* Gets a list of command aliases defined in the server properties.
*
* @return a map of aliases to command names
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@NotNull
public Map<String, String[]> getCommandAliases();

Expand Down Expand Up @@ -2207,7 +2213,10 @@ default int getAmbientSpawnLimit() {
* Gets the active {@link org.bukkit.command.CommandMap}
*
* @return the active command map
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@NotNull
org.bukkit.command.CommandMap getCommandMap();

Expand Down Expand Up @@ -2486,6 +2495,11 @@ public void restart() {

void reloadPermissions(); // Paper

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
boolean reloadCommandAliases(); // Paper

// Paper start - allow preventing player name suggestions by default
Expand Down
4 changes: 4 additions & 0 deletions paper-api/src/main/java/org/bukkit/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

/**
* Represents a Command, which executes various tasks upon user input
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public abstract class Command {
private String name;
private String nextLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

/**
* Represents a class which contains a single method for executing commands
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public interface CommandExecutor {

/**
Expand All @@ -18,6 +22,9 @@ public interface CommandExecutor {
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return true if a valid command, otherwise false
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args);
}
5 changes: 5 additions & 0 deletions paper-api/src/main/java/org/bukkit/command/CommandMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public interface CommandMap {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public class FormattedCommandAlias extends Command {
private final String[] formatStrings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

/**
* Represents a command that delegates to one or more other commands
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public class MultipleCommandAlias extends Command {
private Command[] commands;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

/**
* Represents a {@link Command} belonging to a plugin
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public final class PluginCommand extends Command implements PluginIdentifiableCommand {
private final Plugin owningPlugin;
private CommandExecutor executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public class PluginCommandYamlParser {

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
* sub-indexes based on the {@link Plugin} they are a part of. Custom command
* implementations will need to implement this interface to have a sub-index
* automatically generated on the plugin's behalf.
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public interface PluginIdentifiableCommand {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public class SimpleCommandMap implements CommandMap {
protected final Map<String, Command> knownCommands;
private final Server server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

/**
* Represents a class which can suggest tab completions for commands.
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public interface TabCompleter {

/**
Expand All @@ -21,7 +25,10 @@ public interface TabCompleter {
* partial argument to be completed
* @return A List of possible completions for the final argument, or null
* to default to the command executor
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
@Nullable
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args);
}
4 changes: 4 additions & 0 deletions paper-api/src/main/java/org/bukkit/command/TabExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
/**
* This class is provided as a convenience to implement both TabCompleter and
* CommandExecutor.
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public interface TabExecutor extends TabCompleter, CommandExecutor {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import org.bukkit.command.Command;
import org.jetbrains.annotations.NotNull;

/**
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public abstract class BukkitCommand extends Command {
protected BukkitCommand(@NotNull String name) {
super(name);
Expand Down
11 changes: 11 additions & 0 deletions paper-api/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,24 @@ public final void init(Server server, PluginDescriptionFile description, File da

/**
* {@inheritDoc}
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Override
@Deprecated(since = "26.3")
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return false;
}

/**
* {@inheritDoc}
*
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Override
@Deprecated(since = "26.3")
public @Nullable List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return null;
}
Expand All @@ -332,7 +340,10 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
* @return the plugin command if found, otherwise null
* @throws UnsupportedOperationException if this plugin is a paper plugin and the method is called in {@link #onEnable()}
* @see #registerCommand(String, String, Collection, BasicCommand)
* @deprecated plugin developers should prefer to use the
* <a href="https://docs.papermc.io/paper/dev/command-api/basics/introduction/">Brigadier command API</a>
*/
@Deprecated(since = "26.3")
public @Nullable PluginCommand getCommand(String name) {
if (this.isBeingEnabled && !(pluginMeta instanceof PluginDescriptionFile)) {
throw new UnsupportedOperationException("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ public Logger getLogger() {
}

@Override
@Deprecated
public PluginCommand getPluginCommand(String name) {
Command command = this.commandMap.getCommand(name);

Expand Down Expand Up @@ -1664,6 +1665,7 @@ public boolean removeRecipe(NamespacedKey recipeKey, boolean resendRecipes) {
}

@Override
@Deprecated
public Map<String, String[]> getCommandAliases() {
ConfigurationSection section = this.commandsConfiguration.getConfigurationSection("aliases");
Map<String, String[]> result = new LinkedHashMap<>();
Expand Down Expand Up @@ -2290,6 +2292,7 @@ public HelpMap getHelpMap() {
}

@Override
@Deprecated
public SimpleCommandMap getCommandMap() {
return this.commandMap;
}
Expand Down Expand Up @@ -2858,6 +2861,7 @@ public void reloadPermissions() {
}

@Override
@Deprecated
public boolean reloadCommandAliases() {
Set<String> removals = getCommandAliases().keySet().stream()
.map(key -> key.toLowerCase(java.util.Locale.ENGLISH))
Expand Down
Loading