mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Allow lookup of player's stats from console
Quick change to test new Jenkins+GitPOST
This commit is contained in:
parent
20248212ae
commit
6382bec05a
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
import com.gmail.nossr50.Users;
|
||||||
import com.gmail.nossr50.m;
|
import com.gmail.nossr50.m;
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
import com.gmail.nossr50.mcPermissions;
|
||||||
import com.gmail.nossr50.config.LoadProperties;
|
import com.gmail.nossr50.config.LoadProperties;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -16,6 +17,12 @@ import com.gmail.nossr50.locale.mcLocale;
|
|||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
|
||||||
public class StatsCommand implements CommandExecutor {
|
public class StatsCommand implements CommandExecutor {
|
||||||
|
private final mcMMO plugin;
|
||||||
|
|
||||||
|
public StatsCommand(mcMMO instance) {
|
||||||
|
this.plugin = instance;
|
||||||
|
}
|
||||||
|
|
||||||
@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 (!LoadProperties.statsEnable) {
|
if (!LoadProperties.statsEnable) {
|
||||||
@ -23,12 +30,23 @@ public class StatsCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
sender.sendMessage("This command does not support console useage.");
|
if(args.length != 1) {
|
||||||
|
sender.sendMessage("Usage: stats <username>");
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
Player temp = plugin.getServer().getPlayer(args[0]);
|
||||||
|
if(temp == null) {
|
||||||
|
sender.sendMessage("Could not find player: " + args[0]);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
player = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = (Player) sender;
|
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("mcPlayerListener.YourStats"));
|
player.sendMessage(mcLocale.getString("mcPlayerListener.YourStats"));
|
||||||
|
@ -304,7 +304,7 @@ public class mcMMO extends JavaPlugin
|
|||||||
if(LoadProperties.mmoeditEnable) getCommand("mmoedit").setExecutor(new MmoeditCommand(this));
|
if(LoadProperties.mmoeditEnable) getCommand("mmoedit").setExecutor(new MmoeditCommand(this));
|
||||||
getCommand("mmoupdate").setExecutor(new MmoupdateCommand());
|
getCommand("mmoupdate").setExecutor(new MmoupdateCommand());
|
||||||
if(LoadProperties.myspawnEnable) getCommand("myspawn").setExecutor(new MyspawnCommand());
|
if(LoadProperties.myspawnEnable) getCommand("myspawn").setExecutor(new MyspawnCommand());
|
||||||
if(LoadProperties.statsEnable) getCommand("stats").setExecutor(new StatsCommand());
|
if(LoadProperties.statsEnable) getCommand("stats").setExecutor(new StatsCommand(this));
|
||||||
if(LoadProperties.whoisEnable) getCommand("whois").setExecutor(new WhoisCommand(this));
|
if(LoadProperties.whoisEnable) getCommand("whois").setExecutor(new WhoisCommand(this));
|
||||||
if(LoadProperties.xprateEnable) getCommand("xprate").setExecutor(new XprateCommand());
|
if(LoadProperties.xprateEnable) getCommand("xprate").setExecutor(new XprateCommand());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user