1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 23:13:48 +01:00

ArmorTypes from CMILib

This commit is contained in:
Zrips 2021-06-20 15:51:28 +03:00
parent 3d429e7cb9
commit 3765c336bd
6 changed files with 6 additions and 54 deletions

View File

@ -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 {

View File

@ -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();
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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;