validate that mcnotify isn't being ran by the console

This commit is contained in:
Shane Freeder 2019-07-29 17:23:21 +01:00
parent 51e22f7904
commit 62ce98c8a5
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -14,6 +15,10 @@ import java.util.List;
public class McnotifyCommand implements TabExecutor { public class McnotifyCommand implements TabExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
switch (args.length) { switch (args.length) {
case 0: case 0:
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender); McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);