mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed mmoupdate not being useable from console
This commit is contained in:
parent
03e0c02640
commit
97fd3eaf64
@ -12,6 +12,7 @@ Version 1.3.06-dev
|
||||
+ Added API functions for obtaining offline profiles & profiles via player names
|
||||
+ Changed Archery's Daze to deal 4 DMG on proc (2 Hearts)
|
||||
+ Changed /addlevel command to work for offline users
|
||||
= Fixed mmoupdate not being useable from console
|
||||
! Changed PlayerProfile constructor to always take a boolean
|
||||
! Changed getPlayerProfile function to work for online & offline users
|
||||
|
||||
|
@ -16,24 +16,24 @@ import com.gmail.nossr50.runnables.SQLConversionTask;
|
||||
public class MmoupdateCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
Player player = null;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
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.
|
||||
|
||||
sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
|
||||
Users.clearUsers();
|
||||
convertToMySQL();
|
||||
for (Player x : Bukkit.getServer().getOnlinePlayers()) {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user