From a2cefd78aa4d73c6382bee17ebea730fe12a657f Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Thu, 2 Jul 2020 17:11:38 +0200 Subject: [PATCH] Change command requirements for base command. Fixes #52 --- .../bluemap/common/plugin/commands/Commands.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java index 8fc439a5..4b53a890 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java @@ -87,7 +87,7 @@ public void init() { // commands LiteralCommandNode baseCommand = literal("bluemap") - .requires(requirements("bluemap.status")) + .requires(requirementsUnloaded("bluemap.status")) .executes(this::statusCommand) .build(); @@ -277,6 +277,11 @@ private Optional parseUUID(String uuidString) { public int statusCommand(CommandContext context) { 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()); return 1; }