Skip to content

Commit

Permalink
Make the plugin optional for CommandMapping
Browse files Browse the repository at this point in the history
This is because we don't necessarily know the plugin or mod that registers a command via Brigadier
  • Loading branch information
Daniel Naylor committed Oct 9, 2021
1 parent a572f60 commit 0c268e3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.spongepowered.api.command.registrar.CommandRegistrar;
import org.spongepowered.plugin.PluginContainer;

import java.util.Optional;
import java.util.Set;

/**
Expand Down Expand Up @@ -59,11 +60,11 @@ public interface CommandMapping {
Set<String> allAliases();

/**
* Gets the plugin that owns the command.
* Gets the plugin that owns the command, if known.
*
* @return The plugin.
*/
PluginContainer plugin();
Optional<PluginContainer> plugin();

/**
* Gets the {@link CommandRegistrar} that registered this command.
Expand Down

0 comments on commit 0c268e3

Please sign in to comment.