From 999a1fc2247d7c7f5e1e116209d036f70a06f852 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 25 Jan 2024 12:59:14 +0200 Subject: [PATCH] New placeholder to show bonus in percentage from between 0 and 100 %jobsr_user_pboost_[job]_[currency]% --- pom.xml | 4 ++-- .../java/com/gamingmesh/jobs/Placeholders/Placeholder.java | 4 ++++ .../com/gamingmesh/jobs/listeners/JobsPaymentListener.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3b0a10a3..8d895234 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Jobs jobs - 5.2.2.1 + 5.2.2.2 Jobs http://maven.apache.org @@ -288,7 +288,7 @@ maven-jar-plugin 2.3.1 - build/jar + D:/MC/Server 1.20/plugins diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index 038e26ea..affe1245 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -71,6 +71,7 @@ public class Placeholder { user_jobs, user_boost_$1_$2("jname/number", "money/exp/points"), + user_pboost_$1_$2("jname/number", "money/exp/points"), user_isin_$1("jname/number"), user_canjoin_$1("jname/number"), user_jlevel_$1("jname/number"), @@ -535,6 +536,9 @@ public class Placeholder { case user_boost_$1_$2: Boost boost = Jobs.getPlayerManager().getFinalBonus(user, job, true, true); return (vals.size() < 2 || j == null) ? "" : simplifyDouble(boost.getFinal(CurrencyType.getByName(vals.get(1)), false, true)); + case user_pboost_$1_$2: + boost = Jobs.getPlayerManager().getFinalBonus(user, job, true, true); + return (vals.size() < 2 || j == null) ? "" : simplifyDouble(boost.getFinal(CurrencyType.getByName(vals.get(1)), false, true) * 100D); case user_isin_$1: return job == null ? "no" : convert(user.isInJob(job)); case user_job_$1: diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index a6eb10b7..e1813e0b 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1087,7 +1087,7 @@ public final class JobsPaymentListener implements Listener { if (!Jobs.getGCManager().preventShopItemEnchanting) return; - if (!Jobs.getPlayerManager().containsItemBoostByNBT(event.getInventory().getContents()[0])) + if (!ItemBoostManager.containsItemBoostByNBT(event.getInventory().getContents()[0])) return; if (!CMIMaterial.get(event.getInventory().getContents()[1]).equals(CMIMaterial.ENCHANTED_BOOK))