Merge pull request #3890 from OverCrave/master

Fix adminchat returning too early if send by the console
This commit is contained in:
Robert A. C 2019-04-18 15:13:21 -07:00 committed by GitHub
commit c509daff9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,14 +55,13 @@ public abstract class ChatCommand implements TabExecutor {
return true; return true;
case 1: case 1:
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
if (CommandUtils.shouldEnableToggle(args[0])) { if (CommandUtils.shouldEnableToggle(args[0])) {
if (CommandUtils.noConsoleUsage(sender)) { if (CommandUtils.noConsoleUsage(sender)) {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
enableChatMode(UserManager.getPlayer(sender.getName()), sender); enableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true; return true;
@ -72,6 +71,9 @@ public abstract class ChatCommand implements TabExecutor {
if (CommandUtils.noConsoleUsage(sender)) { if (CommandUtils.noConsoleUsage(sender)) {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
disableChatMode(UserManager.getPlayer(sender.getName()), sender); disableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true; return true;