mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Add nicer error when using player commands as console.
Also fix slash counts for Bukkit.
This commit is contained in:
@ -469,6 +469,10 @@ public final class PlatformCommandManager {
|
||||
store.injectValue(Key.of(Actor.class), ValueProvider.constant(actor));
|
||||
if (actor instanceof Player) {
|
||||
store.injectValue(Key.of(Player.class), ValueProvider.constant((Player) actor));
|
||||
} else {
|
||||
store.injectValue(Key.of(Player.class), context -> {
|
||||
throw new CommandException(TextComponent.of("This command must be used with a player."), ImmutableList.of());
|
||||
});
|
||||
}
|
||||
store.injectValue(Key.of(Arguments.class), ValueProvider.constant(event::getArguments));
|
||||
store.injectValue(Key.of(LocalSession.class),
|
||||
|
Reference in New Issue
Block a user