Fixed mmoupdate not being useable from console

This commit is contained in:
nossr50 2012-04-04 08:05:41 -07:00
parent 03e0c02640
commit 97fd3eaf64
2 changed files with 12 additions and 11 deletions

View File

@ -12,6 +12,7 @@ Version 1.3.06-dev
+ Added API functions for obtaining offline profiles & profiles via player names + Added API functions for obtaining offline profiles & profiles via player names
+ Changed Archery's Daze to deal 4 DMG on proc (2 Hearts) + Changed Archery's Daze to deal 4 DMG on proc (2 Hearts)
+ Changed /addlevel command to work for offline users + Changed /addlevel command to work for offline users
= Fixed mmoupdate not being useable from console
! Changed PlayerProfile constructor to always take a boolean ! Changed PlayerProfile constructor to always take a boolean
! Changed getPlayerProfile function to work for online & offline users ! Changed getPlayerProfile function to work for online & offline users

View File

@ -16,24 +16,24 @@ import com.gmail.nossr50.runnables.SQLConversionTask;
public class MmoupdateCommand implements CommandExecutor { public class MmoupdateCommand implements CommandExecutor {
@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 (!(sender instanceof Player)) { Player player = null;
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
if(sender instanceof Player) {
player = (Player)sender;
}
if (sender instanceof Player && !mcPermissions.getInstance().admin(player)) {
sender.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true; return true;
} }
Player player = (Player) sender; sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
if (!mcPermissions.getInstance().admin(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
player.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
Users.clearUsers(); Users.clearUsers();
convertToMySQL(); convertToMySQL();
for (Player x : Bukkit.getServer().getOnlinePlayers()) { for (Player x : Bukkit.getServer().getOnlinePlayers()) {
Users.addUser(x); Users.addUser(x);
} }
player.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale. sender.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.
return true; return true;
} }