Change command requirements for base command. Fixes #52

This commit is contained in:
Blue (Lukas Rieger) 2020-07-02 17:11:38 +02:00
parent 0fe7cf94a9
commit a2cefd78aa

View File

@ -87,7 +87,7 @@ public void init() {
// commands // commands
LiteralCommandNode<S> baseCommand = LiteralCommandNode<S> baseCommand =
literal("bluemap") literal("bluemap")
.requires(requirements("bluemap.status")) .requires(requirementsUnloaded("bluemap.status"))
.executes(this::statusCommand) .executes(this::statusCommand)
.build(); .build();
@ -277,6 +277,11 @@ private Optional<UUID> parseUUID(String uuidString) {
public int statusCommand(CommandContext<S> context) { public int statusCommand(CommandContext<S> context) {
CommandSource source = commandSourceInterface.apply(context.getSource()); CommandSource source = commandSourceInterface.apply(context.getSource());
if (!plugin.isLoaded()) {
source.sendMessage(Text.of(TextColor.RED, "BlueMap is not loaded! Try /bluemap reload"));
return 0;
}
source.sendMessages(helper.createStatusMessage()); source.sendMessages(helper.createStatusMessage());
return 1; return 1;
} }