From 7fbfab2c4cc2233868126648274dbd64ca42e489 Mon Sep 17 00:00:00 2001 From: Zrips Date: Tue, 19 Feb 2019 18:10:39 +0200 Subject: [PATCH] Lets check offhand for boosted item --- .../java/com/gamingmesh/jobs/PlayerManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 1f44eca0..aa023f4c 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -34,6 +34,8 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Tameable; import org.bukkit.inventory.ItemStack; +import com.gamingmesh.jobs.CMILib.ItemReflection; +import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.api.JobsJoinEvent; import com.gamingmesh.jobs.api.JobsLeaveEvent; import com.gamingmesh.jobs.api.JobsLevelUpEvent; @@ -54,6 +56,7 @@ import com.gamingmesh.jobs.dao.JobsDAO; import com.gamingmesh.jobs.dao.JobsDAOData; import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.economy.PointsData; +import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.PerformCommands; public class PlayerManager { @@ -750,6 +753,16 @@ public class PlayerManager { if (jitem != null && jitem.getJobs().contains(prog)) data.add(jitem.getBoost(this.getJobsPlayer(player).getJobProgression(prog))); + // Lets check offhand + if (Version.isCurrentEqualOrHigher(Version.v1_9_R1)) { + iih = ItemReflection.getItemInOffHand(player); + if (iih != null) { + jitem = getJobsItemByNbt(iih); + if (jitem != null && jitem.getJobs().contains(prog)) + data.add(jitem.getBoost(this.getJobsPlayer(player).getJobProgression(prog))); + } + } + for (ItemStack OneArmor : player.getInventory().getArmorContents()) { if (OneArmor == null || OneArmor.getType() == org.bukkit.Material.AIR) continue;