From 3765c336bdcd0b00de45bed3434c430407fa221b Mon Sep 17 00:00:00 2001 From: Zrips Date: Sun, 20 Jun 2021 15:51:28 +0300 Subject: [PATCH] ArmorTypes from CMILib --- .../com/gamingmesh/jobs/Gui/GuiManager.java | 1 - .../com/gamingmesh/jobs/ItemBoostManager.java | 2 + .../com/gamingmesh/jobs/PlayerManager.java | 1 + .../gamingmesh/jobs/container/ArmorTypes.java | 52 ------------------- .../jobs/container/JobsArmorChangeEvent.java | 2 + .../jobs/listeners/JobsListener.java | 2 +- 6 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java diff --git a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java index ffa0c2ce..ae61eec6 100644 --- a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java +++ b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java @@ -22,7 +22,6 @@ import com.gamingmesh.jobs.container.JobsPlayer; import net.Zrips.CMILib.CMILib; import net.Zrips.CMILib.GUI.CMIGui; import net.Zrips.CMILib.GUI.CMIGuiButton; -import net.Zrips.CMILib.GUI.GUIManager; import net.Zrips.CMILib.GUI.GUIManager.GUIClickType; public class GuiManager { diff --git a/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java b/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java index 0b73ff0a..13c65c69 100644 --- a/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java +++ b/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java @@ -22,6 +22,7 @@ import com.gamingmesh.jobs.container.JobItems; import net.Zrips.CMILib.Colors.CMIChatColor; import net.Zrips.CMILib.FileHandler.ConfigReader; import net.Zrips.CMILib.Items.CMIMaterial; +import net.Zrips.CMILib.Logs.CMIDebug; public class ItemBoostManager { @@ -227,6 +228,7 @@ public class ItemBoostManager { ITEMS.put(node, item); } + Jobs.consoleMsg("&e[Jobs] Loaded " + ITEMS.size() + " boosted items!"); cfg.save(); } diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index fad88fd5..e2799186 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -64,6 +64,7 @@ import com.gamingmesh.jobs.stuff.Util; import net.Zrips.CMILib.CMILib; import net.Zrips.CMILib.ActionBar.CMIActionBar; import net.Zrips.CMILib.Items.CMIItemStack; +import net.Zrips.CMILib.Logs.CMIDebug; import net.Zrips.CMILib.NBT.CMINBT; import net.Zrips.CMILib.Version.Version; diff --git a/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java b/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java deleted file mode 100644 index ef0b1d3a..00000000 --- a/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.gamingmesh.jobs.container; - -import org.bukkit.inventory.ItemStack; - -import net.Zrips.CMILib.Items.CMIMaterial; - -public enum ArmorTypes { - HELMET(5), CHESTPLATE(6), LEGGINGS(7), BOOTS(8), ELYTRA(6); - - private final int slot; - - ArmorTypes(int slot) { - this.slot = slot; - } - - public final static ArmorTypes matchType(final ItemStack itemStack) { - switch (CMIMaterial.get(itemStack)) { - case DIAMOND_HELMET: - case GOLDEN_HELMET: - case IRON_HELMET: - case CHAINMAIL_HELMET: - case LEATHER_HELMET: - return HELMET; - case DIAMOND_CHESTPLATE: - case GOLDEN_CHESTPLATE: - case IRON_CHESTPLATE: - case CHAINMAIL_CHESTPLATE: - case LEATHER_CHESTPLATE: - return CHESTPLATE; - case DIAMOND_LEGGINGS: - case GOLDEN_LEGGINGS: - case IRON_LEGGINGS: - case CHAINMAIL_LEGGINGS: - case LEATHER_LEGGINGS: - return LEGGINGS; - case DIAMOND_BOOTS: - case GOLDEN_BOOTS: - case IRON_BOOTS: - case CHAINMAIL_BOOTS: - case LEATHER_BOOTS: - return BOOTS; - case ELYTRA: - return ELYTRA; - default: - return null; - } - } - - public int getSlot() { - return slot; - } -} diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsArmorChangeEvent.java b/src/main/java/com/gamingmesh/jobs/container/JobsArmorChangeEvent.java index a23276bc..c7078af0 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsArmorChangeEvent.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsArmorChangeEvent.java @@ -6,6 +6,8 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.bukkit.inventory.ItemStack; +import net.Zrips.CMILib.Items.ArmorTypes; + public final class JobsArmorChangeEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 28fe507c..34860fc4 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -71,7 +71,6 @@ import com.gamingmesh.jobs.Signs.SignUtil; import com.gamingmesh.jobs.Signs.jobsSign; import com.gamingmesh.jobs.api.JobsAreaSelectionEvent; import com.gamingmesh.jobs.api.JobsChunkChangeEvent; -import com.gamingmesh.jobs.container.ArmorTypes; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobLimitedItems; import com.gamingmesh.jobs.container.JobProgression; @@ -81,6 +80,7 @@ import com.gamingmesh.jobs.container.JobsPlayer; import net.Zrips.CMILib.ActionBar.CMIActionBar; import net.Zrips.CMILib.Colors.CMIChatColor; +import net.Zrips.CMILib.Items.ArmorTypes; import net.Zrips.CMILib.Items.CMIItemStack; import net.Zrips.CMILib.Items.CMIMaterial; import net.Zrips.CMILib.Version.Version;