From 817b5364cfa9b77858d152ef05943af65ca81113 Mon Sep 17 00:00:00 2001 From: OverCrave Date: Thu, 18 Apr 2019 22:58:50 +0200 Subject: [PATCH 1/2] fix adminchat returning too early if send by console --- .../com/gmail/nossr50/commands/chat/ChatCommand.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 0d9b8fcd0..836835828 100644 --- a/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -55,11 +55,10 @@ public abstract class ChatCommand implements TabExecutor { return true; case 1: - if (!CommandUtils.hasPlayerDataKey(sender)) { - return true; - } - if (CommandUtils.shouldEnableToggle(args[0])) { + if (!CommandUtils.hasPlayerDataKey(sender)) { + return true; + } if (CommandUtils.noConsoleUsage(sender)) { return true; } @@ -69,6 +68,9 @@ public abstract class ChatCommand implements TabExecutor { } if (CommandUtils.shouldDisableToggle(args[0])) { + if (!CommandUtils.hasPlayerDataKey(sender)) { + return true; + } if (CommandUtils.noConsoleUsage(sender)) { return true; } From ce9232970538d7b581e7d9308784ba02bc9b26bd Mon Sep 17 00:00:00 2001 From: OverCrave Date: Thu, 18 Apr 2019 22:59:52 +0200 Subject: [PATCH 2/2] fix it for real now --- .../java/com/gmail/nossr50/commands/chat/ChatCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 836835828..b1d93685a 100644 --- a/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -56,10 +56,10 @@ public abstract class ChatCommand implements TabExecutor { case 1: if (CommandUtils.shouldEnableToggle(args[0])) { - if (!CommandUtils.hasPlayerDataKey(sender)) { + if (CommandUtils.noConsoleUsage(sender)) { return true; } - if (CommandUtils.noConsoleUsage(sender)) { + if (!CommandUtils.hasPlayerDataKey(sender)) { return true; } @@ -68,10 +68,10 @@ public abstract class ChatCommand implements TabExecutor { } if (CommandUtils.shouldDisableToggle(args[0])) { - if (!CommandUtils.hasPlayerDataKey(sender)) { + if (CommandUtils.noConsoleUsage(sender)) { return true; } - if (CommandUtils.noConsoleUsage(sender)) { + if (!CommandUtils.hasPlayerDataKey(sender)) { return true; }