From f52effb0fb383a486129e22f983cf8d042d954e7 Mon Sep 17 00:00:00 2001 From: Pablo <26825567+Pabsb@users.noreply.github.com> Date: Mon, 22 Mar 2021 15:13:51 -0500 Subject: [PATCH] Add '.all' to all existing perk xp multipliers (#4460) * Add '.all' to all existing perk xp multipliers Added '.all' usage for all existing perk xp mulipliers to enable use of mcmmo.perks.xp..all * Fixed a statement error --- .../com/gmail/nossr50/util/Permissions.java | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index 21df34696..a64c476f3 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -118,16 +118,39 @@ public final class Permissions { public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase(Locale.ENGLISH)); } /* XP PERKS */ - public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } + public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.quadruple.all") + || permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + + public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.triple.all") + || permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + + public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.150percentboost.all") + || permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + + public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.double.all") + || permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + + public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.50percentboost.all") + || permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + + public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.10percentboost.all") + || permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); + } public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost.all") - ||permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase(Locale.ENGLISH)); + || permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase(Locale.ENGLISH)); }