mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
Permissions must use the English names.
This commit is contained in:
parent
a8cfcf31ab
commit
b92b9c6507
@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.utilities.SkillTools;
|
import com.gmail.nossr50.skills.utilities.SkillTools;
|
||||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SkillresetCommand implements CommandExecutor {
|
public class SkillresetCommand implements CommandExecutor {
|
||||||
@ -48,7 +47,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sender.hasPermission("mcmmo.commands.skillreset." + SkillTools.getSkillName(skillType).toLowerCase())) {
|
if (!sender.hasPermission("mcmmo.commands.skillreset." + skillType.toString().toLowerCase())) {
|
||||||
sender.sendMessage(command.getPermissionMessage());
|
sender.sendMessage(command.getPermissionMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -62,13 +61,13 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
skill = SkillType.getSkill(args[0]);
|
skill = SkillType.getSkill(args[0]);
|
||||||
skillName = SkillTools.getSkillName(skill);
|
skillName = SkillTools.getSkillName(skill);
|
||||||
|
|
||||||
if (!sender.hasPermission("mcmmo.commands.skillreset." + skillName.toLowerCase())) {
|
if (!sender.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase())) {
|
||||||
sender.sendMessage(command.getPermissionMessage());
|
sender.sendMessage(command.getPermissionMessage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.modifySkill(skill, 0);
|
profile.modifySkill(skill, 0);
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.Reset.Single", StringUtils.getCapitalized(skillName)));
|
sender.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skillName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -91,7 +90,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
skill = SkillType.getSkill(args[1]);
|
skill = SkillType.getSkill(args[1]);
|
||||||
skillName = SkillTools.getSkillName(skill);
|
skillName = SkillTools.getSkillName(skill);
|
||||||
|
|
||||||
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + skillName.toLowerCase())) {
|
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase())) {
|
||||||
sender.sendMessage(command.getPermissionMessage());
|
sender.sendMessage(command.getPermissionMessage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -114,7 +113,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + SkillTools.getSkillName(skillType).toLowerCase())) {
|
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + skillType.toString().toLowerCase())) {
|
||||||
sender.sendMessage(command.getPermissionMessage());
|
sender.sendMessage(command.getPermissionMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -137,7 +136,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + SkillTools.getSkillName(skillType).toLowerCase())) {
|
if (!sender.hasPermission("mcmmo.commands.skillreset.others." + skillType.toString().toLowerCase())) {
|
||||||
sender.sendMessage(command.getPermissionMessage());
|
sender.sendMessage(command.getPermissionMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -149,7 +148,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
profile.modifySkill(skill, 0);
|
profile.modifySkill(skill, 0);
|
||||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Reset.Single", StringUtils.getCapitalized(skillName)));
|
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Reset.Single", skillName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +156,7 @@ public class SkillresetCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.2", StringUtils.getCapitalized(skillName), args[0]));
|
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.2", skillName, args[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user