mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Oops.
This commit is contained in:
parent
bc6233541a
commit
c460eec0ab
@ -26,7 +26,7 @@ public class MmoeditCommand 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) {
|
||||||
OfflinePlayer modifiedPlayer;
|
OfflinePlayer modifiedPlayer;
|
||||||
PlayerProfile orofile;
|
PlayerProfile profile;
|
||||||
int newValue;
|
int newValue;
|
||||||
SkillType skill;
|
SkillType skill;
|
||||||
String skillName;
|
String skillName;
|
||||||
@ -48,7 +48,7 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
modifiedPlayer = (Player) sender;
|
modifiedPlayer = (Player) sender;
|
||||||
newValue = Integer.valueOf(args[1]);
|
newValue = Integer.valueOf(args[1]);
|
||||||
skill = Skills.getSkillType(args[0]);
|
skill = Skills.getSkillType(args[0]);
|
||||||
orofile = Users.getProfile(modifiedPlayer);
|
profile = Users.getProfile(modifiedPlayer);
|
||||||
|
|
||||||
if (skill.equals(SkillType.ALL)) {
|
if (skill.equals(SkillType.ALL)) {
|
||||||
skillName = "all skills";
|
skillName = "all skills";
|
||||||
@ -57,7 +57,7 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
skillName = Misc.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
orofile.modifySkill(skill, newValue);
|
profile.modifySkill(skill, newValue);
|
||||||
sender.sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
|
sender.sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -94,19 +94,19 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
modifiedPlayer = plugin.getServer().getOfflinePlayer(args[0]);
|
modifiedPlayer = plugin.getServer().getOfflinePlayer(args[0]);
|
||||||
|
|
||||||
if (modifiedPlayer.isOnline()) {
|
if (modifiedPlayer.isOnline()) {
|
||||||
orofile = Users.getProfile(modifiedPlayer);
|
profile = Users.getProfile(modifiedPlayer);
|
||||||
|
|
||||||
((Player) modifiedPlayer).sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
|
((Player) modifiedPlayer).sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
|
||||||
sender.sendMessage(ChatColor.RED + skillName + " has been modified for " + args[0] + "."); //TODO: Use locale
|
sender.sendMessage(ChatColor.RED + skillName + " has been modified for " + args[0] + "."); //TODO: Use locale
|
||||||
|
|
||||||
orofile.modifySkill(skill, newValue);
|
profile.modifySkill(skill, newValue);
|
||||||
orofile.save();
|
profile.save();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
orofile = new PlayerProfile(modifiedPlayer, false); //Temporary Profile
|
profile = new PlayerProfile(modifiedPlayer, false); //Temporary Profile
|
||||||
|
|
||||||
if (!orofile.isLoaded()) {
|
if (!profile.isLoaded()) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user