Skip to content

Commit 0553016

Browse files
committed
Add the permission check to the registration
1 parent bd74486 commit 0553016

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/spongepowered/api/command/manager/CommandManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package org.spongepowered.api.command.manager;
2626

2727
import org.spongepowered.api.command.Command;
28+
import org.spongepowered.api.command.CommandCause;
2829
import org.spongepowered.api.command.CommandResult;
2930
import org.spongepowered.api.command.exception.CommandException;
3031
import org.spongepowered.api.command.registrar.CommandRegistrar;
@@ -37,6 +38,7 @@
3738
import java.util.Collection;
3839
import java.util.List;
3940
import java.util.Optional;
41+
import java.util.function.Predicate;
4042

4143
/**
4244
* Registers and dispatches commands
@@ -137,6 +139,8 @@ public interface CommandManager {
137139
* @param container The {@link PluginContainer} to register the command for
138140
* @param commandTree The {@link CommandTreeBuilder} that represents this command
139141
* structure
142+
* @param requirement What a {@link CommandCause} needs to fulfil in order for this
143+
* command to be executed.
140144
* @param primaryAlias The first command alias to register
141145
* @param secondaryAliases Secondary aliases to register, if any
142146
* @return The {@link CommandMapping} containing the command mapping
@@ -147,6 +151,7 @@ public interface CommandManager {
147151
CommandMapping registerAlias(CommandRegistrar registrar,
148152
PluginContainer container,
149153
CommandTreeBuilder.Basic commandTree,
154+
Predicate<CommandCause> requirement,
150155
String primaryAlias,
151156
String... secondaryAliases)
152157
throws CommandFailedRegistrationException;

0 commit comments

Comments
 (0)