mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Adding proper children for the deprecated permissions, and removing extra permissions checks.
This commit is contained in:
@ -23,11 +23,6 @@ public class AddlevelsCommand implements CommandExecutor{
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (!Permissions.mmoedit(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sender instanceof Player) {
|
||||
if (!SkillTools.isSkill(args[0])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
@ -55,7 +50,7 @@ public class AddlevelsCommand implements CommandExecutor{
|
||||
}
|
||||
|
||||
case 3:
|
||||
if (!Permissions.hasPermission(sender, "mcmmo.commands.addlevels.others") && !Permissions.mmoedit(sender)) {
|
||||
if (!Permissions.hasPermission(sender, "mcmmo.commands.addlevels.others")) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.addxp") && !Permissions.mmoedit((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.addxp")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.addxp.others") && !Permissions.mmoedit((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.addxp.others")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit") && !Permissions.mmoedit((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit.others") && !Permissions.mmoedit((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit.others")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.utilities.SkillTools;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
public class SkillResetCommand implements CommandExecutor {
|
||||
@ -34,7 +33,7 @@ public class SkillResetCommand implements CommandExecutor {
|
||||
|
||||
skill = SkillTools.getSkillType(args[0]);
|
||||
|
||||
if (CommandHelper.noCommandPermissions((Player) sender, "mcmmo.commands.skillreset." + skill.toString().toLowerCase()) && !Permissions.skillReset((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions((Player) sender, "mcmmo.commands.skillreset." + skill.toString().toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ public class SkillResetCommand implements CommandExecutor {
|
||||
|
||||
skill = SkillTools.getSkillType(args[1]);
|
||||
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()) && !Permissions.skillReset((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.skillreset.others." + skill.toString().toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ import com.gmail.nossr50.commands.CommandHelper;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public class XprateCommand implements CommandExecutor {
|
||||
private static double originalRate = Config.getInstance().getExperienceGainsGlobalMultiplier();
|
||||
@ -21,7 +20,7 @@ public class XprateCommand implements CommandExecutor {
|
||||
String usage2 = LocaleLoader.getString("Commands.xprate.proper.1");
|
||||
String usage3 = LocaleLoader.getString("Commands.xprate.proper.2");
|
||||
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate") && !Permissions.admin((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -30,7 +29,7 @@ public class XprateCommand implements CommandExecutor {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("reset")) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.reset") && !Permissions.admin((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.reset")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -57,7 +56,7 @@ public class XprateCommand implements CommandExecutor {
|
||||
|
||||
case 2:
|
||||
if (Misc.isInt(args[0])) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.set") && !Permissions.admin((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.set")) {
|
||||
return true;
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
|
||||
|
@ -10,7 +10,6 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.commands.CommandHelper;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
public class McabilityCommand implements CommandExecutor {
|
||||
@ -21,7 +20,7 @@ public class McabilityCommand implements CommandExecutor {
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mcability") && !Permissions.mcAbility((Player) sender)) {
|
||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mcability")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user