From b14985f156c40762821c71cabd12785c49df8878 Mon Sep 17 00:00:00 2001 From: smuddgge <68658429+smuddgge@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:05:12 +0100 Subject: [PATCH] Added 25% xp boost permission --- .../com/gmail/nossr50/util/Permissions.java | 7 +- .../gmail/nossr50/util/skills/PerksUtils.java | 3 + src/main/resources/plugin.yml | 71 +++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index 2dabff51e..c405f84ab 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -133,7 +133,12 @@ public final class Permissions { return permissible.hasPermission("mcmmo.perks.xp.50percentboost.all") || permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } - + + public static boolean oneAndAQuarterXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.25percentboost.all") + || permissible.hasPermission("mcmmo.perks.xp.25percentboost." + 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)); diff --git a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java index 1aa39105a..2d83cb063 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java @@ -74,6 +74,9 @@ public final class PerksUtils { else if (Permissions.oneAndOneHalfXp(player, skill)) { modifier = 1.5; } + else if (Permissions.oneAndAQuarterXp(player, skill)) { + modifier = 1.25; + } else if (Permissions.oneAndOneTenthXp(player, skill)) { modifier = 1.1; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 2173e7de9..23915d427 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1495,6 +1495,7 @@ permissions: children: mcmmo.perks.xp.150percentboost.all: true mcmmo.perks.xp.50percentboost.all: true + mcmmo.perks.xp.25percentboost.all: true mcmmo.perks.xp.10percentboost.all: true mcmmo.perks.xp.customboost.all: true mcmmo.perks.xp.double.all: true @@ -1640,6 +1641,76 @@ permissions: mcmmo.perks.xp.50percentboost.woodcutting: default: false description: Multiplies incoming Woodcutting XP by 1.5 + mcmmo.perks.xp.25percentboost.*: + default: false + description: Multiplies incoming XP by 1.25 + children: + mcmmo.perks.xp.25percentboost.all: true + mcmmo.perks.xp.25percentboost: + default: false + description: Multiplies incoming XP by 1.25 + children: + mcmmo.perks.xp.25percentboost.all: true + mcmmo.perks.xp.25percentboost.all: + default: false + description: Multiplies incoming XP by 1.25 + children: + mcmmo.perks.xp.25percentboost.acrobatics: true + mcmmo.perks.xp.25percentboost.alchemy: true + mcmmo.perks.xp.25percentboost.archery: true + mcmmo.perks.xp.25percentboost.axes: true + mcmmo.perks.xp.25percentboost.excavation: true + mcmmo.perks.xp.25percentboost.fishing: true + mcmmo.perks.xp.25percentboost.herbalism: true + mcmmo.perks.xp.25percentboost.mining: true + mcmmo.perks.xp.25percentboost.repair: true + mcmmo.perks.xp.25percentboost.smelting: true + mcmmo.perks.xp.25percentboost.swords: true + mcmmo.perks.xp.25percentboost.taming: true + mcmmo.perks.xp.25percentboost.unarmed: true + mcmmo.perks.xp.25percentboost.woodcutting: true + mcmmo.perks.xp.25percentboost.acrobatics: + default: false + description: Multiplies incoming Acrobatics XP by 1.25 + mcmmo.perks.xp.25percentboost.alchemy: + default: false + description: Multiplies incoming Acrobatics XP by 1.25 + mcmmo.perks.xp.25percentboost.archery: + default: false + description: Multiplies incoming Archery XP by 1.25 + mcmmo.perks.xp.25percentboost.axes: + default: false + description: Multiplies incoming Axes XP by 1.25 + mcmmo.perks.xp.25percentboost.excavation: + default: false + description: Multiplies incoming Excavation XP by 1.25 + mcmmo.perks.xp.25percentboost.fishing: + default: false + description: Multiplies incoming Fishing XP by 1.25 + mcmmo.perks.xp.25percentboost.herbalism: + default: false + description: Multiplies incoming Herbalism XP by 1.25 + mcmmo.perks.xp.25percentboost.mining: + default: false + description: Multiplies incoming Mining XP by 1.25 + mcmmo.perks.xp.25percentboost.repair: + default: false + description: Multiplies incoming Repair XP by 1.25 + mcmmo.perks.xp.25percentboost.smelting: + default: false + description: Multiplies incoming Smelting XP by 1.25 + mcmmo.perks.xp.25percentboost.swords: + default: false + description: Multiplies incoming Swords XP by 1.25 + mcmmo.perks.xp.25percentboost.taming: + default: false + description: Multiplies incoming Taming XP by 1.25 + mcmmo.perks.xp.25percentboost.unarmed: + default: false + description: Multiplies incoming Unarmed XP by 1.5 + mcmmo.perks.xp.25percentboost.woodcutting: + default: false + description: Multiplies incoming Woodcutting XP by 1.25 mcmmo.perks.xp.10percentboost.*: default: false description: Multiplies incoming XP by 1.1