Skip to content

Commit 0c268e3

Browse files
author
Daniel Naylor
committed
Make the plugin optional for CommandMapping
This is because we don't necessarily know the plugin or mod that registers a command via Brigadier
1 parent a572f60 commit 0c268e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.spongepowered.api.command.registrar.CommandRegistrar;
2828
import org.spongepowered.plugin.PluginContainer;
2929

30+
import java.util.Optional;
3031
import java.util.Set;
3132

3233
/**
@@ -59,11 +60,11 @@ public interface CommandMapping {
5960
Set<String> allAliases();
6061

6162
/**
62-
* Gets the plugin that owns the command.
63+
* Gets the plugin that owns the command, if known.
6364
*
6465
* @return The plugin.
6566
*/
66-
PluginContainer plugin();
67+
Optional<PluginContainer> plugin();
6768

6869
/**
6970
* Gets the {@link CommandRegistrar} that registered this command.

0 commit comments

Comments
 (0)