diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffect.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffect.java new file mode 100644 index 00000000..c67f4550 --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffect.java @@ -0,0 +1,71 @@ +package com.gamingmesh.jobs.CMILib; + +import org.bukkit.Color; +import org.bukkit.util.Vector; + +import com.gamingmesh.jobs.CMILib.CMIEffectManager.CMIParticle; + +public class CMIEffect { + + private CMIParticle particle; + private Color color = Color.fromBGR(0, 0, 200); + private Vector offset = new Vector(); + private int size = 1; + private int amount = 1; + private float speed = 0; + + public CMIEffect(CMIParticle particle) { + this.particle = particle; + } + + public CMIParticle getParticle() { + if (particle == null) + particle = CMIParticle.COLOURED_DUST; + return particle; + } + + public void setParticle(CMIParticle particle) { + this.particle = particle; + } + + public Color getColor() { + return color; + } + + public void setColor(Color color) { + this.color = color; + } + + public Vector getOffset() { + return offset; + } + + public void setOffset(Vector offset) { + this.offset = offset; + } + + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = amount; + } + + public float getSpeed() { + return speed; + } + + public void setSpeed(float speed) { + this.speed = speed; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + +} diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java new file mode 100644 index 00000000..f643b22c --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java @@ -0,0 +1,433 @@ +package com.gamingmesh.jobs.CMILib; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Effect; +import org.bukkit.Effect.Type; +import org.bukkit.Material; + +import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; + +public class CMIEffectManager { + + public enum CMIParticleType { + SOUND, VISUAL, PARTICLE, NONE; + } + + public enum CMIParticleDataType { + Void, DustOptions, ItemStack, BlockData, MaterialData; + } + + public enum CMIParticle { + CLICK2("null", 0, CMIParticleType.SOUND, null), + CLICK1("null", 1, CMIParticleType.SOUND, null), + BOW_FIRE("null", 2, CMIParticleType.SOUND, null), + DOOR_TOGGLE("null", 3, CMIParticleType.SOUND, null), + IRON_DOOR_TOGGLE("null", 4, CMIParticleType.SOUND, null), + TRAPDOOR_TOGGLE("null", 5, CMIParticleType.SOUND, null), + IRON_TRAPDOOR_TOGGLE("null", 6, CMIParticleType.SOUND, null), + FENCE_GATE_TOGGLE("null", 7, CMIParticleType.SOUND, null), + DOOR_CLOSE("null", 8, CMIParticleType.SOUND, null), + IRON_DOOR_CLOSE("null", 9, CMIParticleType.SOUND, null), + TRAPDOOR_CLOSE("null", 10, CMIParticleType.SOUND, null), + IRON_TRAPDOOR_CLOSE("null", 11, CMIParticleType.SOUND, null), + FENCE_GATE_CLOSE("null", 12, CMIParticleType.SOUND, null), + EXTINGUISH("null", 13, CMIParticleType.SOUND, null), + RECORD_PLAY("null", 14, CMIParticleType.SOUND, null), + GHAST_SHRIEK("null", 15, CMIParticleType.SOUND, null), + GHAST_SHOOT("null", 16, CMIParticleType.SOUND, null), + BLAZE_SHOOT("null", 17, CMIParticleType.SOUND, null), + ZOMBIE_CHEW_WOODEN_DOOR("null", 18, CMIParticleType.SOUND, null), + ZOMBIE_CHEW_IRON_DOOR("null", 19, CMIParticleType.SOUND, null), + ZOMBIE_DESTROY_DOOR("null", 20, CMIParticleType.SOUND, null), + SMOKE("null", 21, CMIParticleType.VISUAL, null), + STEP_SOUND("null", 22, CMIParticleType.SOUND, null), + POTION_BREAK("null", 23, CMIParticleType.VISUAL, null), + ENDER_SIGNAL("null", 24, CMIParticleType.VISUAL, null), + MOBSPAWNER_FLAMES("null", 25, CMIParticleType.VISUAL, null), + BREWING_STAND_BREW("null", 26, CMIParticleType.SOUND, null), + CHORUS_FLOWER_GROW("null", 27, CMIParticleType.SOUND, null), + CHORUS_FLOWER_DEATH("null", 28, CMIParticleType.SOUND, null), + PORTAL_TRAVEL("null", 29, CMIParticleType.SOUND, null), + ENDEREYE_LAUNCH("null", 30, CMIParticleType.SOUND, null), + FIREWORK_SHOOT("null", 31, CMIParticleType.SOUND, null), + VILLAGER_PLANT_GROW("null", 32, CMIParticleType.VISUAL, null), + DRAGON_BREATH("null", 33, CMIParticleType.VISUAL, null), + ANVIL_BREAK("null", 34, CMIParticleType.SOUND, null), + ANVIL_USE("null", 35, CMIParticleType.SOUND, null), + ANVIL_LAND("null", 36, CMIParticleType.SOUND, null), + ENDERDRAGON_SHOOT("null", 37, CMIParticleType.SOUND, null), + WITHER_BREAK_BLOCK("null", 38, CMIParticleType.SOUND, null), + WITHER_SHOOT("null", 39, CMIParticleType.SOUND, null), + ZOMBIE_INFECT("null", 40, CMIParticleType.SOUND, null), + ZOMBIE_CONVERTED_VILLAGER("null", 41, CMIParticleType.SOUND, null), + BAT_TAKEOFF("null", 42, CMIParticleType.SOUND, null), + END_GATEWAY_SPAWN("null", 43, CMIParticleType.VISUAL, null), + ENDERDRAGON_GROWL("null", 44, CMIParticleType.SOUND, null), + FIREWORKS_SPARK("fireworksSpark", 45, CMIParticleType.PARTICLE, CMIMaterial.FIRE_CHARGE.getMaterial()), + CRIT("crit", 46, CMIParticleType.PARTICLE, Material.IRON_SWORD), + MAGIC_CRIT("CRIT_MAGIC", 47, CMIParticleType.PARTICLE, Material.POTION), + POTION_SWIRL("mobSpell", "SPELL_MOB", 48, CMIParticleType.PARTICLE, Material.BLAZE_ROD), + POTION_SWIRL_TRANSPARENT("mobSpellAmbient", "SPELL_MOB_AMBIENT", 49, CMIParticleType.PARTICLE, Material.BLAZE_POWDER), + SPELL("spell", 50, CMIParticleType.PARTICLE, Material.MILK_BUCKET), + INSTANT_SPELL("instantSpell", "SPELL_INSTANT", 51, CMIParticleType.PARTICLE, Material.GLASS_BOTTLE), + WITCH_MAGIC("witchMagic", "SPELL_WITCH", 52, CMIParticleType.PARTICLE, Material.SPIDER_EYE), + NOTE("note", 53, CMIParticleType.PARTICLE, Material.NOTE_BLOCK), + PORTAL("portal", 54, CMIParticleType.PARTICLE, Material.OBSIDIAN), + FLYING_GLYPH("enchantmenttable", 55, CMIParticleType.PARTICLE, CMIMaterial.ENCHANTING_TABLE.getMaterial()), + FLAME("flame", 56, CMIParticleType.PARTICLE, CMIMaterial.FIRE_CHARGE.getMaterial()), + LAVA_POP("lava", 57, CMIParticleType.PARTICLE, Material.FLINT_AND_STEEL), + FOOTSTEP("footstep", 58, CMIParticleType.PARTICLE, Material.IRON_BOOTS), + SPLASH("splash", "water splash", 59, CMIParticleType.PARTICLE, Material.STICK), + PARTICLE_SMOKE("smoke", "SMOKE_NORMAL", 60, CMIParticleType.PARTICLE, Material.ANVIL), + EXPLOSION_HUGE("hugeexplosion", 61, CMIParticleType.PARTICLE, Material.FURNACE), + EXPLOSION_LARGE("largeexplode", 62, CMIParticleType.PARTICLE, Material.FURNACE), + EXPLOSION("explode", "EXPLOSION_NORMAL", 63, CMIParticleType.PARTICLE, Material.TNT), + VOID_FOG("depthsuspend", "SUSPENDED_DEPTH", 64, CMIParticleType.PARTICLE, CMIMaterial.SALMON.getMaterial()), + SMALL_SMOKE("townaura", 65, CMIParticleType.PARTICLE, CMIMaterial.MYCELIUM.getMaterial()), + CLOUD("cloud", 66, CMIParticleType.PARTICLE, CMIMaterial.COBWEB.getMaterial()), + COLOURED_DUST("reddust", "redstone", 67, CMIParticleType.PARTICLE, Material.REDSTONE, CMIParticleDataType.DustOptions), + SNOWBALL_BREAK("snowballpoof", "SNOWBALL", 68, CMIParticleType.PARTICLE, CMIMaterial.SNOWBALL.getMaterial()), + WATERDRIP("dripWater", "WATER_DROP", 69, CMIParticleType.PARTICLE, Material.WATER_BUCKET), + LAVADRIP("dripLava", 70, CMIParticleType.PARTICLE, Material.LAVA_BUCKET), + SNOW_SHOVEL("snowshovel", 71, CMIParticleType.PARTICLE, CMIMaterial.DIAMOND_SHOVEL.getMaterial()), + SLIME("slime", 72, CMIParticleType.PARTICLE, Material.SLIME_BALL), + HEART("heart", 73, CMIParticleType.PARTICLE, CMIMaterial.ROSE_RED.getMaterial()), + VILLAGER_THUNDERCLOUD("angryVillager", "VILLAGER_ANGRY", 74, CMIParticleType.PARTICLE, Material.EMERALD), + HAPPY_VILLAGER("VILLAGER_HAPPY", 75, CMIParticleType.PARTICLE, Material.BOOK), + LARGE_SMOKE("largesmoke", "SMOKE_LARGE", 76, CMIParticleType.PARTICLE, Material.FURNACE), + ITEM_BREAK("iconcrack", 77, CMIParticleType.NONE, Material.DIAMOND_BOOTS), +// TILE_BREAK("blockcrack", 78, CMIParticleType.PARTICLE, CMIMaterial.MELON.getMaterial(), CMIParticleDataType.MaterialData), +// TILE_DUST("blockdust", 79, CMIParticleType.PARTICLE, CMIMaterial.MELON.getMaterial(), CMIParticleDataType.MaterialData), + + // 1.13 + + WATER_BUBBLE("WATER_BUBBLE", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + WATER_WAKE("WATER_WAKE", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + SUSPENDED("SUSPENDED", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + BARRIER("BARRIER", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), +// ITEM_CRACK("ITEM_CRACK", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.ItemStack), + MOB_APPEARANCE("MOB_APPEARANCE", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + END_ROD("END_ROD", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + DAMAGE_INDICATOR("DAMAGE_INDICATOR", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + SWEEP_ATTACK("SWEEP_ATTACK", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), +// FALLING_DUST("FALLING_DUST", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.BlockData), + TOTEM("TOTEM", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + SPIT("SPIT", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + SQUID_INK("SQUID_INK", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + BUBBLE_POP("BUBBLE_POP", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + CURRENT_DOWN("CURRENT_DOWN", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + BUBBLE_COLUMN_UP("BUBBLE_COLUMN_UP", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + NAUTILUS("NAUTILUS", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void), + DOLPHIN("DOLPHIN", -1, CMIParticleType.PARTICLE, Material.STONE, CMIParticleDataType.Void); + + private String name; + private String secondaryName = ""; + private int id; + private CMIParticleType type; + private Material icon; + private Object particle; + private Effect effect; + private Object EnumParticle; + private int[] extra; + private CMIParticleDataType dataType = CMIParticleDataType.Void; + + CMIParticle(String name, int id, CMIParticleType type) { + this(name, null, id, type, null); + } + + CMIParticle(String name, int id, CMIParticleType type, Material icon) { + this(name, null, id, type, icon); + } + + CMIParticle(String name, String secondaryName, int id, CMIParticleType type, Material icon) { + this(name, secondaryName, id, type, icon, CMIParticleDataType.Void); + } + + CMIParticle(String name, int id, CMIParticleType type, Material icon, CMIParticleDataType dataType) { + this(name, null, id, type, icon, dataType); + } + + CMIParticle(String name, String secondaryName, int id, CMIParticleType type, Material icon, CMIParticleDataType dataType) { + this.name = name; + this.secondaryName = secondaryName; + this.id = id; + this.type = type; + this.icon = icon; + this.dataType = dataType; + } + + public String getName() { + return name; + } + + public int getId() { + return id; + } + + public CMIParticleType getType() { + return type; + } + + public boolean isParticle() { + return type == CMIParticleType.PARTICLE; + } + + public boolean isColored() { + return this.equals(COLOURED_DUST) || this.equals(NOTE); + } + + public static boolean isParticle(Effect effect) { + if (effect == null) + return false; + CMIParticle cmiEffect = getCMIParticle(effect.toString()); + if (cmiEffect == null) + return false; + return cmiEffect.isParticle(); + } + + public static Material getSafeIcon(Effect effect) { + CMIParticle cmiEffect = getCMIParticle(effect.toString()); + if (cmiEffect == null) + return Material.STONE; + return cmiEffect.getIcon() == null ? Material.STONE : cmiEffect.getIcon(); + } + + public Material getSafeIcon() { + return getIcon() == null ? Material.STONE : getIcon(); + } + + public static CMIParticle getCMIParticle(String name) { + CMIParticle cmiEffect = null; + if (name == null) + return null; + name = name.replace("_", "").toLowerCase(); + for (CMIParticle one : CMIParticle.values()) { + if (one.getName() != null && one.getName().equalsIgnoreCase(name)) { + cmiEffect = one; + break; + } + if (!one.getSecondaryName().isEmpty() && one.getSecondaryName().replace("_", "").equalsIgnoreCase(name)) { + cmiEffect = one; + break; + } + if (one.name().replace("_", "").equalsIgnoreCase(name)) { + cmiEffect = one; + break; + } + } + if (cmiEffect != null && Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_9_R1) && cmiEffect.getParticle() == null) + return null; + if (Jobs.getVersionCheckManager().getVersion().isLower(Version.v1_13_R1) && cmiEffect != null && cmiEffect.getEffect() == null) + return null; + return cmiEffect; + } + +// public static Effect getEffect(String name) { +// CMIParticle cmiEffect = getCMIParticle(name); +//// Bukkit.getConsoleSender().sendMessage("1 "+name); +//// Bukkit.getConsoleSender().sendMessage("2 "+cmiEffect); +// +// if (cmiEffect != null) { +// if (!cmiEffect.getType().equals(CMIParticleType.PARTICLE)) +// return null; +// for (Effect one : Effect.values()) { +// if (one.toString().equalsIgnoreCase(cmiEffect.name())) +// return one; +// if (one.toString().equalsIgnoreCase(cmiEffect.getName())) +// return one; +// } +// } else { +// for (Effect one : Effect.values()) { +// if (one.toString().replace("_", "").equalsIgnoreCase(name)) { +// try { +// if (one.getType() != Type.VISUAL) +// return null; +// } catch (Exception | NoSuchMethodError e) { +// return null; +// } +// return one; +// } +// } +// } +// return null; +// } + + public Effect getEffect() { + if (effect != null) + return effect; + if (!isParticle()) + return null; + for (Effect one : Effect.values()) { + if (one.toString().replace("_", "").equalsIgnoreCase(name().replace("_", ""))) { + effect = one; + return one; + } + if (one.toString().replace("_", "").equalsIgnoreCase(getName())) { + effect = one; + return one; + } + } + + for (Effect one : Effect.values()) { + if (one.toString().replace("_", "").equalsIgnoreCase(name.replace("_", ""))) { + try { + if (one.getType() != Type.VISUAL) + return null; + } catch (Exception | NoSuchMethodError e) { + return null; + } + effect = one; + return one; + } + } + return null; + } + + public Material getIcon() { + return icon; + } + + public static List getParticleList() { + List ls = new ArrayList(); + for (CMIParticle one : CMIParticle.values()) { + if (!one.isParticle()) + continue; + if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_9_R1) && one.getParticle() == null) + continue; + if (Jobs.getVersionCheckManager().getVersion().isLower(Version.v1_13_R1) && one.getEffect() == null) + continue; + ls.add(one); + } + return ls; + } + + public CMIParticle getNextPartcileEffect() { + + List ls = getParticleList(); + for (int i = 0; i < ls.size(); i++) { + CMIParticle next = ls.get(i); + if (next == null) + continue; + + if (!next.isParticle()) + continue; + if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_9_R1) && next.getParticle() == null) + continue; + + if (next.equals(this)) { + if (i == ls.size() - 1) + return ls.get(0); + return ls.get(i + 1); + } + } + return this; + } + + public CMIParticle getPrevParticleEffect() { + List ls = getParticleList(); + for (int i = 0; i < ls.size(); i++) { + CMIParticle next = ls.get(i); + + if (next == null) + continue; + + if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_9_R1) && next.getParticle() == null) + continue; + + if (!next.isParticle()) + continue; + if (next.equals(this)) { + if (i == 0) + return ls.get(ls.size() - 1); + return ls.get(i - 1); + } + } + return this; + } + + public String getSecondaryName() { + return secondaryName == null ? "" : secondaryName; + } + + public void setSecondaryName(String secondaryName) { + this.secondaryName = secondaryName; + } + + public org.bukkit.Particle getParticle() { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrLower(Version.v1_8_R3)) + return null; + if (particle == null) { + String n = this.toString().replace("_", "").toLowerCase(); + for (org.bukkit.Particle one : org.bukkit.Particle.values()) { + String name = one.toString().toLowerCase().replace("_", ""); + if (name.equalsIgnoreCase(n)) { + particle = one; + break; + } + } + } + if (particle == null) { + String n = name().replace("_", "").toLowerCase(); + for (org.bukkit.Particle one : org.bukkit.Particle.values()) { + String name = one.toString().toLowerCase().replace("_", ""); + if (name.equalsIgnoreCase(n)) { + particle = one; + break; + } + } + } + if (particle == null) { + String n = getName().replace("_", "").toLowerCase(); + for (org.bukkit.Particle one : org.bukkit.Particle.values()) { + String name = one.toString().toLowerCase().replace("_", ""); + if (name.equalsIgnoreCase(n)) { + particle = one; + break; + } + } + } + if (particle == null) { + String n = getSecondaryName().replace("_", "").toLowerCase(); + if (!n.isEmpty()) { + for (org.bukkit.Particle one : org.bukkit.Particle.values()) { + String name = one.toString().toLowerCase().replace("_", ""); + if (name.equalsIgnoreCase(n)) { + particle = one; + break; + } + } + + if (particle == null) + for (org.bukkit.Particle one : org.bukkit.Particle.values()) { + String name = one.toString().toLowerCase().replace("_", ""); + if (name.contains(n)) { + particle = one; + break; + } + } + } + } + return particle == null ? null : (org.bukkit.Particle) particle; + } + + public Object getEnumParticle() { + return EnumParticle; + } + + public void setEnumParticle(Object enumParticle) { + EnumParticle = enumParticle; + } + + public int[] getExtra() { + return extra; + } + + public void setExtra(int[] extra) { + this.extra = extra; + } + } +} diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java new file mode 100644 index 00000000..9db29a13 --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java @@ -0,0 +1,344 @@ +package com.gamingmesh.jobs.CMILib; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; + +public class CMIItemStack { + + private int id = 0; + private short data = 0; + private short durability = 0; + private int amount = 0; + + private String bukkitName = null; + private String mojangName = null; + private CMIMaterial material = null; + private ItemStack item; + + public CMIItemStack(Material material) { + this.material = CMIMaterial.get(material); + } + + public CMIItemStack(CMIMaterial material) { + this.material = material; + } + + public CMIItemStack(ItemStack item) { + this.setItemStack(item); + } + + @Override + public CMIItemStack clone() { + CMIItemStack cm = new CMIItemStack(material); + cm.setId(id); + cm.setData(data); + cm.setAmount(amount); + cm.setDurability(durability); + cm.setBukkitName(bukkitName); + cm.setMojangName(mojangName); + cm.setCMIMaterial(material); + cm.setItemStack(this.item != null ? this.item.clone() : null); + return cm; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public short getData() { + return data; + } + + public boolean isTool() { + return getMaxDurability() > 0; + } + + public short getDurability() { + return this.getItemStack().getDurability(); + } + + public short getMaxDurability() { + return this.material.getMaxDurability(); + } + + public void setData(short data) { + this.data = data; + } + + public CMIItemStack setDisplayName(String name) { + ItemMeta meta = this.getItemStack().getItemMeta(); + if (meta != null) { + if (name == null) { + meta.setDisplayName(null); + } else + meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); + } + this.getItemStack().setItemMeta(meta); + return this; + } + + public String getDisplayName() { + ItemMeta meta = this.getItemStack().getItemMeta(); + return meta == null || meta.getDisplayName() == null || meta.getDisplayName().isEmpty() ? this.material.getName() : meta.getDisplayName(); + } + + public CMIItemStack addLore(String string) { + if (string == null) + return this; + ItemMeta meta = this.getItemStack().getItemMeta(); + List lore = meta.getLore(); + if (lore == null) + lore = new ArrayList(); + lore.add(ChatColor.translateAlternateColorCodes('&', string)); + meta.setLore(lore); + this.getItemStack().setItemMeta(meta); + return this; + } + + public CMIItemStack clearLore() { + ItemMeta meta = this.getItemStack().getItemMeta(); + List t = new ArrayList(); + meta.setLore(t); + this.getItemStack().setItemMeta(meta); + return this; + } + + public CMIItemStack setLore(List lore) { + if (lore == null || lore.isEmpty()) + return this; + ItemMeta meta = this.getItemStack().getItemMeta(); + List t = new ArrayList(); + for (String one : lore) { + t.add(ChatColor.translateAlternateColorCodes('&', one)); + } + meta.setLore(t); + this.getItemStack().setItemMeta(meta); + return this; + } + + public CMIItemStack addEnchant(Enchantment enchant, Integer level) { + if (enchant == null) + return this; + ItemMeta meta = this.getItemStack().getItemMeta(); + meta.addEnchant(enchant, level, true); + this.getItemStack().setItemMeta(meta); + return this; + } + + public CMIItemStack addEnchant(HashMap enchants) { + if (enchants == null || enchants.isEmpty()) + return this; + for (Entry oneEnch : enchants.entrySet()) { + this.addEnchant(oneEnch.getKey(), oneEnch.getValue()); + } + return this; + } + + public CMIItemStack clearEnchants() { + ItemMeta meta = this.getItemStack().getItemMeta(); + meta.getEnchants().clear(); + this.getItemStack().setItemMeta(meta); + return this; + } + + public List getLore() { + ItemMeta meta = this.getItemStack().getItemMeta(); + if (meta != null) { + List lore = meta.getLore(); + if (lore == null) { + lore = new ArrayList(); + meta.setLore(lore); + } + + return meta.getLore() == null ? new ArrayList() : meta.getLore(); + } + return new ArrayList(); + } + + public String getRealName() { + + return this.material.getName(); + } + + public String getBukkitName() { + return bukkitName == null || bukkitName.isEmpty() ? null : bukkitName; + } + + public void setBukkitName(String bukkitName) { + this.bukkitName = bukkitName; + } + + public String getMojangName() { + return mojangName == null || mojangName.isEmpty() ? null : mojangName; + } + + public void setMojangName(String mojangName) { + if (mojangName != null) + this.mojangName = mojangName.replace("minecraft:", ""); + } + + public Material getType() { + if (material == null) + return null; + return material.getMaterial(); + } + + public CMIMaterial getCMIType() { + return material; + } + + @Deprecated + public Material getMaterial() { + return getType(); + } + + public void setMaterial(Material material) { + this.material = CMIMaterial.get(material); + } + + public void setCMIMaterial(CMIMaterial material) { + this.material = material; + } + + @SuppressWarnings("deprecation") + public ItemStack getItemStack() { + if (item == null) { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_13_R1)) { + this.item = new ItemStack(material.getMaterial(), this.amount == 0 ? 1 : this.amount); + } else { + this.item = new ItemStack(material.getMaterial(), this.amount == 0 ? 1 : this.amount, data); + } + + if (this.item.getType() == Material.POTION || item.getType().name().contains("SPLASH_POTION") || item.getType().name().contains("TIPPED_ARROW")) { + PotionMeta potion = (PotionMeta) item.getItemMeta(); + PotionEffectType effect = PotionEffectType.getById(data); + if (effect != null) { + potion.addCustomEffect(new PotionEffect(PotionEffectType.getById(data), 60, 0), true); + } + item.setItemMeta(potion); + item.setDurability((short) 0); + + potion = (PotionMeta) item.getItemMeta(); + potion.setDisplayName(this.getRealName()); + item.setItemMeta(potion); + } + } + return item; + } + + @SuppressWarnings("deprecation") + public CMIItemStack setItemStack(ItemStack item) { + this.item = item; + if (item != null) { + this.id = item.getType().getId(); + this.amount = item.getAmount(); + this.material = CMIMaterial.get(item); + if ((material.isBlock() || material.isSolid())) { + data = item.getData().getData(); + } + if (item.getType().getMaxDurability() - item.getDurability() < 0) { + data = item.getData().getData(); + } + + if (item.getType().getMaxDurability() > 15) { + data = (short) 0; + } + + if (item.getType() == Material.POTION || item.getType().name().contains("SPLASH_POTION") || item.getType().name().contains("TIPPED_ARROW")) { + PotionMeta potion = (PotionMeta) item.getItemMeta(); + try { + if (potion != null && potion.getBasePotionData() != null && potion.getBasePotionData().getType() != null && potion.getBasePotionData().getType().getEffectType() != null) { + data = (short) potion.getBasePotionData().getType().getEffectType().getId(); + } + } catch (NoSuchMethodError e) { + } + } + } + return this; + } + + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = amount; + } + + public boolean isSimilar(ItemStack item) { + return isSimilar(ItemManager.getItem(item)); + } + + public boolean isSimilar(CMIItemStack item) { + if (item == null) + return false; + return this.material.equals(item.material) && this.getData() == item.getData(); + } + +// public boolean hasNbtTag() { +// return CMI.getInstance().getRef().hasNbt(this.getItemStack()); +// } + +// public List getRecipesFor() { +// ItemStack i = getItemStack().clone(); +// i.getData().setData((byte) data); +// if (i.getType().getMaxDurability() > 15) +// i.setDurability((short) 0); +// return Bukkit.getRecipesFor(i); +// } +// +// public List getRecipesFrom() { +// ItemStack i = getItemStack().clone(); +// i.getData().setData((byte) data); +// if (i.getType().getMaxDurability() > 15) +// i.setDurability((short) 0); +// Iterator it = Bukkit.recipeIterator(); +// List recipes = new ArrayList(); +// while (it.hasNext()) { +// Recipe rec = it.next(); +// for (ItemStack one : CMI.getInstance().getRecipeManager().getIngredientsList(rec)) { +// if (one.isSimilar(i)) { +// recipes.add(rec); +// break; +// } +// } +// } +// +// return recipes; +// } + + public void setDurability(short durability) { + this.durability = durability; + } + +// public Set getValidEnchants() { +// Set enchants = new HashSet(); +// for (Enchantment one : CMIEnchantment.values()) { +// if (!CMIEnchantment.isEnabled(one)) +// continue; +// if (one.canEnchantItem(this.getItemStack())) +// enchants.add(one); +// } +// return enchants; +// } + +} diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java new file mode 100644 index 00000000..0c32fcfb --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -0,0 +1,1913 @@ +package com.gamingmesh.jobs.CMILib; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.UUID; + +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.block.Block; +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.meta.SkullMeta; + +import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; + +public class ItemManager { + + static HashMap byId = new HashMap(); + static HashMap byBukkitName = new HashMap(); + static HashMap byMojangName = new HashMap(); + static HashMap byMaterial = new HashMap(); + static Version version; + + public static void load() { + version = Jobs.getVersionCheckManager().getVersion(); + for (CMIMaterial one : CMIMaterial.values()) { + if (one == null) + continue; + one.updateMaterial(); + Material mat = one.getMaterial(); + + if (mat == null) { + continue; + } + + int id = one.getId(); + int data = one.getLegacyData(); + int legacyId = one.getLegacyId(); + + String bukkitName = one.name(); + String mojangName = one.name(); + try { + mojangName = ItemReflection.getItemMinecraftName(new ItemStack(mat)); + } catch (Exception e) { + } + CMIItemStack cm = new CMIItemStack(one); + + cm.setId(id); + cm.setData((short) (data > 0 ? data : 0)); + + cm.setBukkitName(bukkitName); + cm.setMojangName(mojangName); + + byBukkitName.put(id + ":" + cm.getData(), cm); + byBukkitName.put(legacyId + ":" + cm.getData(), cm); + if (!one.getLegacyName().isEmpty()) { + byBukkitName.put(one.getLegacyName().toLowerCase().replace("_", "").replace(" ", ""), cm); + } + byBukkitName.put(one.name().toLowerCase().replace("_", "").replace(" ", ""), cm); + + String n = mojangName.toLowerCase().replace("_", "").replace(" ", "").replace("minecraft:", ""); + + if (!byMojangName.containsKey(n)) + byMojangName.put(n, cm); + byMaterial.put(one, cm); + if (!byId.containsKey(id)) + byId.put(id, cm); + if (!byId.containsKey(one.getLegacyId())) + byId.put(one.getLegacyId(), cm); + } + + for (Material one : Material.class.getEnumConstants()) { + CMIMaterial mat = CMIMaterial.get(one); + if (mat == null && !one.toString().startsWith("LEGACY_")) { + CMIItemStack cm = new CMIItemStack(new ItemStack(one)); + cm.setId(one.getId()); + cm.setBukkitName(one.name()); + byBukkitName.put(one.getId() + ":" + cm.getData(), cm); + byBukkitName.put(one.name().toLowerCase().replace("_", "").replace(" ", ""), cm); + String mojangName = one.name(); + try { + mojangName = ItemReflection.getItemMinecraftName(new ItemStack(one)); + } catch (Exception e) { + } + cm.setMojangName(mojangName); + String n = mojangName.toLowerCase().replace("_", "").replace(" ", "").replace("minecraft:", ""); + if (!byMojangName.containsKey(n)) + byMojangName.put(n, cm); + if (!byId.containsKey(one.getId())) + byId.put(one.getId(), cm); + } + } + + } + + @Deprecated + public static CMIItemStack getItem(Material mat) { + CMIItemStack cm = byMaterial.get(CMIMaterial.get(mat)); + return cm.clone(); + } + + public static CMIItemStack getItem(CMIMaterial mat) { + CMIItemStack cm = byMaterial.get(mat); + return cm.clone(); + } + + public static CMIItemStack getItem(ItemStack item) { + if (item == null) + item = new ItemStack(Material.AIR); + CMIItemStack cm = getItem(CMIMaterial.get(item)); + cm.setItemStack(item); + return cm; + } + + static HashMap headCache = new HashMap(); + + public static CMIItemStack getItem(String name) { + if (byBukkitName.isEmpty()) + load(); + CMIItemStack cm = null; + name = name.toLowerCase().replace("_", "").replace("minecraft:", ""); + String original = name; + Integer amount = null; + if (name.contains("-")) { + String a = name.split("-")[1]; + try { + amount = Integer.parseInt(a); + } catch (Exception e) { + } + name = name.split("-")[0]; + } + + short data = -999; + + if (name.contains(":")) { + try { + data = (short) Integer.parseInt(name.split(":")[1]); + } catch (Exception e) { + } + try { + CMIEntityType e = CMIEntityType.getByName(name.split(":")[1]); + if (e != null) + data = e.getType().getTypeId(); + } catch (Exception e) { + } + name = name.split(":")[0]; + } + + switch (name.toLowerCase()) { + case "skull": + cm = byMaterial.get(CMIMaterial.SKELETON_SKULL); + break; + case "door": + cm = byMaterial.get(CMIMaterial.SPRUCE_DOOR); + break; + case "head": + cm = byMaterial.get(CMIMaterial.PLAYER_HEAD); + data = 3; + + main: if (original.contains(":")) { + + ItemStack old = headCache.get(original); + if (old != null) { + cm.setItemStack(old); + } else { + String d = original.split(":")[1]; + ItemStack skull = new ItemStack(CMIMaterial.PLAYER_HEAD.getMaterial(), 1, (byte) 3); + SkullMeta skullMeta = (SkullMeta) skull.getItemMeta(); + if (d.length() == 36) { + try { + OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(d)); + skullMeta.setOwningPlayer(offPlayer); + } catch (Exception e) { + break main; + } + skull.setItemMeta(skullMeta); + } else { + skullMeta.setOwner(d); + skull.setItemMeta(skullMeta); + } + headCache.put(original, skull); + cm.setItemStack(skull); + } + } + + break; + } + + if (cm == null) { + cm = byBukkitName.get(name); + if (cm == null) { + try { + cm = byId.get(Integer.parseInt(name)); + } catch (Exception e) { + } + + if (cm == null) { + cm = byMojangName.get(name); + if (cm == null) { + for (Material one : Material.class.getEnumConstants()) { + if (one.name().replace("_", "").equalsIgnoreCase(name)) { + cm = byMaterial.get(CMIMaterial.get(one)); + break; + } + } + if (cm == null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getName().replace(" ", "").equalsIgnoreCase(name)) { + cm = byMaterial.get(one); + if (cm != null && data == -999) { + data = one.getData(); + } + break; + } + } + if (cm == null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getName().replace(" ", "").toLowerCase().startsWith(name)) { + cm = byMaterial.get(one); + if (cm != null && data == -999) { + data = one.getData(); + } + break; + } + } + } + if (cm == null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getName().replace(" ", "").toLowerCase().contains(name)) { + cm = byMaterial.get(one); + if (cm != null && data == -999) { + data = one.getData(); + } + break; + } + } + } + if (cm == null) { + for (Entry one : byMojangName.entrySet()) { + if (one.getKey().contains(name)) { + cm = one.getValue(); + if (cm != null && data == -999) { + data = one.getValue().getData(); + } + break; + } + } + } + } + } + } + } + } + + CMIItemStack ncm = null; + if (cm != null) + ncm = cm.clone(); + + if (ncm != null && data != -999) { + if (ncm.getMaxDurability() > 15) + ncm.setData((short) 0); + else { + ncm.setData(data); + } + } + if (ncm != null && amount != null) + ncm.setAmount(amount); + return ncm; + } + + static public List getAllRecipes() { + List results = new ArrayList(); + Iterator iter = Bukkit.recipeIterator(); + while (iter.hasNext()) { + Recipe recipe = iter.next(); + results.add(recipe); + } + return results; + } + + static public List getRecipesFor(ItemStack result) { + + List results = new ArrayList(); + Iterator iter = Bukkit.recipeIterator(); + while (iter.hasNext()) { + Recipe recipe = iter.next(); + ItemStack stack = recipe.getResult(); + if (stack.getType() != result.getType()) { + continue; + } + if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) { + results.add(recipe); + } + } + return results; + } + + static public Material getMaterial(String name) { + CMIItemStack cm = getItem(name); + if (cm == null) + return Material.AIR; + return cm.getMaterial(); + } + + public enum colorNames { + White(0, "White"), + Orange(1, "Orange"), + Magenta(2, "Magenta"), + Light(3, "Light Blue"), + Yellow(4, "Yellow"), + Lime(5, "Lime"), + Pink(6, "Pink"), + Gray(7, "Gray"), + Light_Gray(8, "Light Gray"), + Cyan(9, "Cyan"), + Purple(10, "Purple"), + Blue(11, "Blue"), + Brown(12, "Brown"), + Green(13, "Green"), + Red(14, "Red"), + Black(15, "Black"); + + private int id; + private String name; + + colorNames(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public static colorNames getById(int id) { + for (colorNames one : colorNames.values()) { + if (one.getId() == id) + return one; + } + return colorNames.White; + } + } + + public enum CMIEntityType { + + DROPPED_ITEM(1, "Item"), + EXPERIENCE_ORB(2, "Experience Orb"), + AREA_EFFECT_CLOUD(3, "Area Effect Cloud"), + ELDER_GUARDIAN(4, "Elder Guardian"), + WITHER_SKELETON(5, "Wither Skeleton"), + STRAY(6, "Stray"), + EGG(7, "Thrown Egg"), + LEASH_HITCH(8, "Leash Knot"), + PAINTING(9, "Painting"), + ARROW(10, "Arrow"), + SNOWBALL(11, "Snowball"), + FIREBALL(12, "Fireball"), + SMALL_FIREBALL(13, "Small Fireball"), + ENDER_PEARL(14, "Thrown Ender Pearl"), + ENDER_SIGNAL(15, "End Signal"), + SPLASH_POTION(16, "Splash Potion"), + THROWN_EXP_BOTTLE(17, "Thrown Bottle o' Enchanting"), + ITEM_FRAME(18, "Item Frame"), + WITHER_SKULL(19, "Wither Skull"), + PRIMED_TNT(20, "Primed TNT"), + FALLING_BLOCK(21, "Falling Block"), + FIREWORK(22, "Firework Rocket"), + HUSK(23, "Husk"), + SPECTRAL_ARROW(24, "Spectral Arrow"), + SHULKER_BULLET(25, "Shulker Bullet"), + DRAGON_FIREBALL(26, "Dragon Fireball"), + ZOMBIE_VILLAGER(27, "Zombie Villager"), + SKELETON_HORSE(28, "Skeleton Horse"), + ZOMBIE_HORSE(29, "Zombie Horse"), + ARMOR_STAND(30, "Armor Stand"), + DONKEY(31, "Donkey"), + MULE(32, "Mule"), + EVOKER_FANGS(33, "Evoker Fangs"), + EVOKER(34, "Evoker"), + VEX(35, "Vex"), + VINDICATOR(36, "Vindicator"), + ILLUSIONER(37, "Illusioner"), + MINECART_COMMAND(40, "Minecart with Command Block"), + BOAT(41, "Boat"), + MINECART(42, "Minecart"), + MINECART_CHEST(43, "Minecart with Chest"), + MINECART_FURNACE(44, "Minecart with Furnace"), + MINECART_TNT(45, "Minecart with TNT"), + MINECART_HOPPER(46, "Minecart with Hopper"), + MINECART_MOB_SPAWNER(47, "Minecart with Spawner"), + CREEPER(50, "Creeper"), + SKELETON(51, "Skeleton"), + SPIDER(52, "Spider"), + GIANT(53, "Giant"), + ZOMBIE(54, "Zombie"), + SLIME(55, "Slime"), + GHAST(56, "Ghast"), + PIG_ZOMBIE(57, "Zombie Pigman"), + ENDERMAN(58, "Enderman"), + CAVE_SPIDER(59, "Cave Spider"), + SILVERFISH(60, "Silverfish"), + BLAZE(61, "Blaze"), + MAGMA_CUBE(62, "Magma Cube"), + ENDER_DRAGON(63, "Ender Dragon"), + WITHER(64, "Wither"), + BAT(65, "Bat"), + WITCH(66, "Witch"), + ENDERMITE(67, "Endermite"), + GUARDIAN(68, "Guardian"), + SHULKER(69, "Shulker"), + PIG(90, "Pig"), + SHEEP(91, "Sheep"), + COW(92, "Cow"), + CHICKEN(93, "Chicken"), + SQUID(94, "Squid"), + WOLF(95, "Wolf"), + MUSHROOM_COW(96, "Mushroom Cow"), + SNOWMAN(97, "Snowman"), + OCELOT(98, "Ocelot"), + IRON_GOLEM(99, "Iron Golem"), + HORSE(100, "Horse"), + RABBIT(101, "Rabbit"), + POLAR_BEAR(102, "Polar Bear"), + LLAMA(103, "Llama"), + LLAMA_SPIT(104, "Llama Spit"), + PARROT(105, "Parrot"), + VILLAGER(120, "Villager"), + ENDER_CRYSTAL(200, "End Crystal"), + TURTLE(-1, "Turtle"), + PHANTOM(-1, "Phantom"), + TRIDENT(-1, "Trident"), + COD(-1, "Cod"), + SALMON(-1, "Salmon"), + PUFFERFISH(-1, "Pufferfish"), + TROPICAL_FISH(-1, "Tropical Fish"), + DROWNED(-1, "Drowned"), + DOLPHIN(-1, "Dolphin"), + LINGERING_POTION(-1, "Lingering Potion"), + FISHING_HOOK(-1, "Fishing Hook"), + LIGHTNING(-1, "Lightning Bolt"), + WEATHER(-1, "Weather"), + PLAYER(-1, "Player"), + COMPLEX_PART(-1, "Complex Part"), + TIPPED_ARROW(-1, "Tipped Arrow"), + UNKNOWN(-1, "Unknown"); + + private int id; + private String name; + EntityType type = null; + + CMIEntityType(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public static CMIEntityType getById(int id) { + for (CMIEntityType one : CMIEntityType.values()) { + if (one.getId() == id) + return one; + } + return CMIEntityType.PIG; + } + + public static CMIEntityType getByType(EntityType entity) { + return getByName(entity.toString()); + } + + public static CMIEntityType getByName(String name) { + String main = name; + String sub = null; + + if (name.contains("_")) { + main = name.split("_")[0]; + sub = name.split("_")[1]; + } + if (name.contains(":")) { + main = name.split(":")[0]; + sub = name.split(":")[1]; + } + + String updated = (main + (sub == null ? "" : sub)).toLowerCase(); + String reverse = ((sub == null ? "" : sub) + main).toLowerCase(); + + CMIEntityType type = null; + + Integer id = null; + try { + id = Integer.parseInt(main); + } catch (Exception e) { + } + + for (CMIEntityType one : CMIEntityType.values()) { + if (one.name().replace("_", "").equalsIgnoreCase(updated) || one.name.replace(" ", "").equalsIgnoreCase(updated)) { + type = one; + break; + } + } + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.name.replace("_", "").contains(updated)) { + type = one; + break; + } + } + + if (sub != null) { + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.name().replace("_", "").equalsIgnoreCase(reverse) || one.name.replace(" ", "").equalsIgnoreCase(reverse)) { + type = one; + break; + } + } + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.name.replace("_", "").contains(reverse)) { + type = one; + break; + } + } + } + + if (id != null) { + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.getId() == id) { + type = one; + break; + } + } + } + + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.name.contains("_")) + continue; + if (one.name.equalsIgnoreCase(main)) { + type = one; + break; + } + } + + return type; + } + + public EntityType getType() { + if (type != null) + return type; + for (EntityType one : EntityType.values()) { + if (one.toString().equalsIgnoreCase(this.name())) { + type = one; + break; + } + } + return type; + } + + public boolean isAlive() { + return getType().isAlive(); + } + + public boolean isSpawnable() { + return getType().isSpawnable(); + } + + public static String getRealNameByType(EntityType type) { + if (type == null) + return null; + CMIEntityType ctype = CMIEntityType.getByType(type); + if (ctype != null) + return ctype.getName(); + String name = type.name(); + + name = name.toLowerCase().replace("_", " "); + name = name.substring(0, 1).toUpperCase() + name.substring(1); + return name; + } + } + + public enum CMIMaterial { + NONE(-1, -1, -1, "None"), + AIR(0, 0, 9648, "Unknown", "Air"), + STONE(1, 0, 22948, "Stone"), + GRANITE(1, 1, 21091, "Granite"), + POLISHED_GRANITE(1, 2, 5477, "Polished Granite"), + DIORITE(1, 3, 24688, "Diorite"), + POLISHED_DIORITE(1, 4, 31615, "Polished Diorite"), + ANDESITE(1, 5, 25975, "Andesite"), + POLISHED_ANDESITE(1, 6, 8335, "Polished Andesite"), + GRASS_BLOCK(2, 0, 28346, "Grass", "Grass Block"), + DIRT(3, 0, 10580, "Dirt"), + COARSE_DIRT(3, 1, 15411, "Coarse Dirt"), + PODZOL(3, 2, 24068, "Podzol"), + COBBLESTONE(4, 0, 32147, "Cobblestone"), + OAK_PLANKS(5, 0, 14905, "Oak Wood Plank", "Oak Planks"), + SPRUCE_PLANKS(5, 1, 14593, "Spruce Wood Plank", "Spruce Planks"), + BIRCH_PLANKS(5, 2, 29322, "Birch Wood Plank", "Birch Planks"), + JUNGLE_PLANKS(5, 3, 26445, "Jungle Wood Plank", "Jungle Planks"), + ACACIA_PLANKS(5, 4, 31312, "Acacia Wood Plank", "Acacia Planks"), + DARK_OAK_PLANKS(5, 5, 20869, "Dark Oak Wood Plank", "Dark Oak Planks"), + OAK_SAPLING(6, 0, 9636, "Oak Sapling"), + SPRUCE_SAPLING(6, 1, 19874, "Spruce Sapling"), + BIRCH_SAPLING(6, 2, 31533, "Birch Sapling"), + JUNGLE_SAPLING(6, 3, 17951, "Jungle Sapling"), + ACACIA_SAPLING(6, 4, 20806, "Acacia Sapling"), + ACACIA_SLAB(126, 4, 23730, "Acacia Wood Slab", "Acacia Slab"), + DARK_OAK_SLAB(126, 5, 28852, "Dark Oak Wood Slab", "Dark Oak Slab"), + COCOA(127, 0, 29709, "Cocoa"), + SANDSTONE_STAIRS(128, 0, 18474, "Sandstone Stairs"), + EMERALD_ORE(129, 0, 16630, "Emerald Ore"), + ENDER_CHEST(130, 0, 32349, "Ender Chest"), + TRIPWIRE_HOOK(131, 0, 8130, "Tripwire Hook"), + TRIPWIRE(132, 0, 8810, "Tripwire"), + EMERALD_BLOCK(133, 0, 9914, "Emerald Block", "Block of Emerald"), + SPRUCE_STAIRS(134, 0, 11192, "Spruce Wood Stairs", "Spruce Stairs"), + BIRCH_STAIRS(135, 0, 7657, "Birch Wood Stairs", "Birch Stairs"), + JUNGLE_STAIRS(136, 0, 20636, "Jungle Wood Stairs", "Jungle Stairs"), + CHAINMAIL_BOOTS(305, 0, 17953, "Chainmail Boots"), + IRON_HELMET(306, 0, 12025, "Iron Helmet"), + IRON_CHESTPLATE(307, 0, 28112, "Iron Chestplate"), + IRON_LEGGINGS(308, 0, 18951, "Iron Leggings"), + IRON_BOOTS(309, 0, 8531, "Iron Boots"), + DIAMOND_HELMET(310, 0, 10755, "Diamond Helmet"), + DIAMOND_CHESTPLATE(311, 0, 32099, "Diamond Chestplate"), + DIAMOND_LEGGINGS(312, 0, 11202, "Diamond Leggings"), + DIAMOND_BOOTS(313, 0, 16522, "Diamond Boots"), + GOLDEN_HELMET(314, 0, 7945, "Golden Helmet"), + GOLDEN_CHESTPLATE(315, 0, 4507, "Golden Chestplate"), + GOLDEN_LEGGINGS(316, 0, 21002, "Golden Leggings"), + GOLDEN_BOOTS(317, 0, 7859, "Golden Boots"), + FLINT(318, 0, 23596, "Flint"), + PORKCHOP(319, 0, 30896, "Raw Porkchop"), + COOKED_PORKCHOP(320, 0, 27231, "Cooked Porkchop", "grilledpork"), + PAINTING(321, 0, 23945, "Painting"), + GOLDEN_APPLE(322, 0, 27732, "Golden Apple"), + ENCHANTED_GOLDEN_APPLE(322, 1, 8280, "Enchanted Golden Apple"), + SIGN(323, 0, 16918, "Sign"), + OAK_DOOR(324, 0, 20341, "Wooden Door", "wooddoor"), + BUCKET(325, 0, 15215, "Bucket"), + WATER_BUCKET(326, 0, 8802, "Water Bucket"), + LAVA_BUCKET(327, 0, 9228, "Lava Bucket"), + MINECART(328, 0, 14352, "Minecart"), + SADDLE(329, 0, 30206, "Saddle"), + IRON_DOOR(330, 0, 4788, "Iron Door"), + REDSTONE(331, 0, 11233, "Redstone", "Redstone Dust"), + SNOWBALL(332, 0, 19487, "Snowball"), + OAK_BOAT(333, 0, 17570, "Boat", "Oak Boat"), + LEATHER(334, 0, 16414, "Leather"), + MILK_BUCKET(335, 0, 9680, "Milk Bucket"), + BRICK(336, 0, 6820, "Brick", "claybrick"), + CLAY_BALL(337, 0, 24603, "Clay Ball", "Clay"), + SUGAR_CANE(338, 0, 7726, "Sugar Canes", "Sugar Cane"), + PAPER(339, 0, 9923, "Paper"), + BOOK(340, 0, 23097, "Book"), + SLIME_BALL(341, 0, 5242, "Slimeball"), + CHEST_MINECART(342, 0, 4497, "Minecart with Chest", "Storageminecart"), + FURNACE_MINECART(343, 0, 14196, "Minecart with Furnace", "POWERED_MINECART"), + EGG(344, 0, 21603, "Egg"), + COMPASS(345, 0, 24139, "Compass"), + FISHING_ROD(346, 0, 4167, "Fishing Rod"), + CLOCK(347, 0, 14980, "Clock", "watch"), + GLOWSTONE_DUST(348, 0, 6665, "Glowstone Dust"), + RAW_FISH(349, 0, 24691, "Raw Fish", "RAW_FISH"), + SALMON(349, 1, 18516, "Raw Salmon"), + CLOWN_FISH(349, 2, 12795, "Clownfish"), + PUFFERFISH(349, 3, 8115, "Pufferfish"), + COOKED_FISH(350, 0, -1, "Cooked Fish", "COOKED_FISH"), + COOKED_SALMON(350, 1, 5615, "Cooked Salmon"), + INK_SAC(351, 0, 7184, "Ink Sack", "Ink Sac"), + ROSE_RED(351, 1, 15694, "Rose Red"), + CACTUS_GREEN(351, 2, 17296, "Cactus Green"), + INK_SACK(351, 3, -1, "Coco Beans", "INK_SACK"), + LAPIS_LAZULI(351, 4, 11075, "Lapis Lazuli"), + PURPLE_DYE(351, 5, 6347, "Purple Dye"), + CYAN_DYE(351, 6, 8043, "Cyan Dye"), + LIGHT_GRAY_DYE(351, 7, 27643, "Light Gray Dye"), + GRAY_DYE(351, 8, 9184, "Gray Dye"), + PINK_DYE(351, 9, 31151, "Pink Dye"), + LIME_DYE(351, 10, 6147, "Lime Dye"), + DANDELION_YELLOW(351, 11, 21789, "Dandelion Yellow"), + LIGHT_BLUE_DYE(351, 12, 28738, "Light Blue Dye"), + MAGENTA_DYE(351, 13, 11788, "Magenta Dye"), + ORANGE_DYE(351, 14, 13866, "Orange Dye"), + BONE_MEAL(351, 15, 32458, "Bone Meal"), + BONE(352, 0, 5686, "Bone"), + SUGAR(353, 0, 30638, "Sugar"), + CAKE(354, 0, 27048, "Cake"), + WHITE_BED(355, 0, 8185, "White Bed", "Bed"), + ORANGE_BED(355, 1, 11194, "Orange Bed", "Orange Bed"), + MAGENTA_BED(355, 2, 20061, "Magenta Bed", "Magenta Bed"), + LIGHT_BLUE_BED(355, 3, 20957, "Light Blue Bed", "Light Blue Bed"), + YELLOW_BED(355, 4, 30410, "Yellow Bed", "Yellow Bed"), + LIME_BED(355, 5, 27860, "Lime Bed", "Lime Bed"), + PINK_BED(355, 6, 13795, "Pink Bed", "Pink Bed"), + GRAY_BED(355, 7, 15745, "Gray Bed", "Gray Bed"), + LIGHT_GRAY_BED(355, 8, 5090, "Light Gray Bed", "Light Gray Bed"), + CYAN_BED(355, 9, 16746, "Cyan Bed", "Cyan Bed"), + PURPLE_BED(355, 10, 29755, "Purple Bed", "Purple Bed"), + BLUE_BED(355, 11, 12714, "Blue Bed", "Blue Bed"), + BROWN_BED(355, 12, 25624, "Brown Bed", "Brown Bed"), + GREEN_BED(355, 13, 13797, "Green Bed", "Green Bed"), + RED_BED(355, 14, 30910, "Red Bed", "Red Bed"), + BLACK_BED(355, 15, 20490, "Black Bed", "Black Bed"), + REPEATER(356, 0, 28823, "Redstone Repeater", "Diode"), + COOKIE(357, 0, 27431, "Cookie"), + FILLED_MAP(358, 0, 23504, "Map"), + SHEARS(359, 0, 27971, "Shears"), + MELON_SLICE(360, 0, 5347, "Melon", "Melon Slice"), + PUMPKIN_SEEDS(361, 0, 28985, "Pumpkin Seeds"), + MELON_SEEDS(362, 0, 18340, "Melon Seeds"), + BEEF(363, 0, 4803, "Raw Beef"), + COOKED_BEEF(364, 0, 21595, "Steak"), + CHICKEN(365, 0, 17281, "Raw Chicken"), + COOKED_CHICKEN(366, 0, 20780, "Cooked Chicken"), + ROTTEN_FLESH(367, 0, 21591, "Rotten Flesh"), + ENDER_PEARL(368, 0, 5259, "Ender Pearl"), + BLAZE_ROD(369, 0, 8289, "Blaze Rod"), + GHAST_TEAR(370, 0, 18222, "Ghast Tear"), + GOLD_NUGGET(371, 0, 28814, "Gold Nugget"), + NETHER_STALK(372, 0, -1, "Nether Wart", "NETHER_STALK"), + POTION(373, 0, 24020, "Potion"), + GLASS_BOTTLE(374, 0, 6116, "Glass Bottle"), + SPIDER_EYE(375, 0, 9318, "Spider Eye"), + FERMENTED_SPIDER_EYE(376, 0, 19386, "Fermented Spider Eye"), + BLAZE_POWDER(377, 0, 18941, "Blaze Powder"), + MAGMA_CREAM(378, 0, 25097, "Magma Cream"), + BREWING_STAND_ITEM(379, 0, -1, "Brewing Stand", "BREWING_STAND_ITEM"), + CAULDRON_ITEM(380, 0, -1, "Cauldron", "CAULDRON_ITEM"), + ENDER_EYE(381, 0, 24860, "Eye of Ender"), + GLISTERING_MELON_SLICE(382, 0, 20158, "Glistering Melon", "speckledmelon"), + ELDER_GUARDIAN_SPAWN_EGG(383, 4, 11418, "Spawn Elder Guardian", "Elder Guardian Spawn Egg"), + WITHER_SKELETON_SPAWN_EGG(383, 5, 10073, "Spawn Wither Skeleton", "Wither Skeleton Spawn Egg"), + STRAY_SPAWN_EGG(383, 6, 30153, "Spawn Stray", "Stray Spawn Egg"), + HUSK_SPAWN_EGG(383, 23, 20178, "Spawn Husk", "Husk Spawn Egg"), + ZOMBIE_VILLAGER_SPAWN_EGG(383, 27, 10311, "Spawn Zombie Villager", "Zombie Villager Spawn Egg"), + SKELETON_HORSE_SPAWN_EGG(383, 28, 21356, "Spawn Skeleton Horse", "Skeleton Horse Spawn Egg"), + ZOMBIE_HORSE_SPAWN_EGG(383, 29, 4275, "Spawn Zombie Horse", "Zombie Horse Spawn Egg"), + ARMOR_STAND_SPAWN_EGG(383, 30, -1, "Spawn Armor Stand", "MONSTER_EGG"), + DONKEY_SPAWN_EGG(383, 31, 14513, "Spawn Donkey", "Donkey Spawn Egg"), + MULE_SPAWN_EGG(383, 32, 11229, "Spawn Mule", "Mule Spawn Egg"), + EVOKER_SPAWN_EGG(383, 34, 19365, "Spawn Evoker", "Evoker Spawn Egg"), + VEX_SPAWN_EGG(383, 35, 27751, "Spawn Vex", "Vex Spawn Egg"), + VINDICATOR_SPAWN_EGG(383, 36, 21672, "Spawn Vindicator", "Vindicator Spawn Egg"), + ILLUSIONER_SPAWN_EGG(383, 37, -1, "Spawn Illusioner", "MONSTER_EGG"), + CREEPER_SPAWN_EGG(383, 50, 9653, "Spawn Creeper", "Creeper Spawn Egg"), + SKELETON_SPAWN_EGG(383, 51, 15261, "Spawn Skeleton", "Skeleton Spawn Egg"), + SPIDER_SPAWN_EGG(383, 52, 14984, "Spawn Spider", "Spider Spawn Egg"), + GIANT_SPAWN_EGG(383, 53, -1, "Spawn Giant", "MONSTER_EGG"), + ZOMBIE_SPAWN_EGG(383, 54, 5814, "Spawn Zombie", "Zombie Spawn Egg"), + SLIME_SPAWN_EGG(383, 55, 6550, "Spawn Slime", "Slime Spawn Egg"), + GHAST_SPAWN_EGG(383, 56, 9970, "Spawn Ghast", "Ghast Spawn Egg"), + ZOMBIE_PIGMAN_SPAWN_EGG(383, 57, 11531, "Spawn Zombie Pigman", "Zombie Pigman Spawn Egg"), + ENDERMAN_SPAWN_EGG(383, 58, 29488, "Spawn Enderman", "Enderman Spawn Egg"), + CAVE_SPIDER_SPAWN_EGG(383, 59, 23341, "Spawn Cave Spider", "Cave Spider Spawn Egg"), + SILVERFISH_SPAWN_EGG(383, 60, 14537, "Spawn Silverfish", "Silverfish Spawn Egg"), + BLAZE_SPAWN_EGG(383, 61, 4759, "Spawn Blaze", "Blaze Spawn Egg"), + MAGMA_CUBE_SPAWN_EGG(383, 62, 26638, "Spawn Magma Cube", "Magma Cube Spawn Egg"), + ENDER_DRAGON_SPAWN_EGG(383, 63, -1, "Spawn Ender Dragon", "MONSTER_EGG"), + WITHER_SPAWN_EGG(383, 64, -1, "Spawn Wither", "MONSTER_EGG"), + BAT_SPAWN_EGG(383, 65, 14607, "Spawn Bat", "Bat Spawn Egg"), + WITCH_SPAWN_EGG(383, 66, 11837, "Spawn Witch", "Witch Spawn Egg"), + ENDERMITE_SPAWN_EGG(383, 67, 16617, "Spawn Endermite", "Endermite Spawn Egg"), + GUARDIAN_SPAWN_EGG(383, 68, 20113, "Spawn Guardian", "Guardian Spawn Egg"), + SHULKER_SPAWN_EGG(383, 69, 31848, "Spawn Shulker", "Shulker Spawn Egg"), + PIG_SPAWN_EGG(383, 90, 22584, "Spawn Pig", "Pig Spawn Egg"), + SHEEP_SPAWN_EGG(383, 91, 24488, "Spawn Sheep", "Sheep Spawn Egg"), + COW_SPAWN_EGG(383, 92, 14761, "Spawn Cow", "Cow Spawn Egg"), + CHICKEN_SPAWN_EGG(383, 93, 5462, "Spawn Chicken", "Chicken Spawn Egg"), + SQUID_SPAWN_EGG(383, 94, 10682, "Spawn Squid", "Squid Spawn Egg"), + WOLF_SPAWN_EGG(383, 95, 21692, "Spawn Wolf", "Wolf Spawn Egg"), + MOOSHROOM_SPAWN_EGG(383, 96, 22125, "Spawn Mushroom Cow", "Mooshroom Spawn Egg"), + SNOWMAN_SPAWN_EGG(383, 97, -1, "Spawn Snowman", "MONSTER_EGG"), + OCELOT_SPAWN_EGG(383, 98, 30080, "Spawn Ocelot", "Ocelot Spawn Egg"), + IRON_GOLEM_SPAWN_EGG(383, 99, -1, "Spawn Iron Golem", "MONSTER_EGG"), + HORSE_SPAWN_EGG(383, 100, 25981, "Spawn Horse", "Horse Spawn Egg"), + RABBIT_SPAWN_EGG(383, 101, 26496, "Spawn Rabbit", "Rabbit Spawn Egg"), + POLAR_BEAR_SPAWN_EGG(383, 102, 17015, "Spawn Polar Bear", "Polar Bear Spawn Egg"), + LLAMA_SPAWN_EGG(383, 103, 23640, "Spawn Llama", "Llama Spawn Egg"), + PARROT_SPAWN_EGG(383, 105, 23614, "Spawn Parrot", "Parrot Spawn Egg"), + VILLAGER_SPAWN_EGG(383, 120, 30348, "Spawn Villager", "Villager Spawn Egg"), + EXPERIENCE_BOTTLE(384, 0, 12858, "Bottle o' Enchanting", "expbottle"), + FIRE_CHARGE(385, 0, 4842, "Fire Charge", "Fireball"), + WRITABLE_BOOK(386, 0, 13393, "Book and Quill"), + WRITTEN_BOOK(387, 0, 24164, "Written Book"), + EMERALD(388, 0, 5654, "Emerald"), + ITEM_FRAME(389, 0, 27318, "Item Frame"), + FLOWER_POT_ITEM(390, 0, -1, "Flower Pot", "FLOWER_POT_ITEM"), + CARROT(391, 0, 22824, "Carrot", "Carrotitem"), + POTATO(392, 0, 21088, "Potato", "Potatoitem"), + BAKED_POTATO(393, 0, 14624, "Baked Potato"), + POISONOUS_POTATO(394, 0, 32640, "Poisonous Potato"), + EMPTY_MAP(395, 0, -1, "Empty Map", "EMPTY_MAP"), + GOLDEN_CARROT(396, 0, 5300, "Golden Carrot"), + SKELETON_SKULL(397, 0, 13270, "Mob Head (Skeleton)", "Skeleton Skull"), + WITHER_SKELETON_SKULL(397, 1, 31487, "Mob Head (Wither Skeleton)", "Wither Skeleton Skull"), + ZOMBIE_HEAD(397, 2, 9304, "Mob Head (Zombie)", "Zombie Head"), + PLAYER_HEAD(397, 3, 21174, "Mob Head (Human)", "Player Head"), + CREEPER_HEAD(397, 4, 29146, "Mob Head (Creeper)", "Creeper Head"), + CARROT_ON_A_STICK(398, 0, 27809, "Carrot on a Stick", "carrotstick"), + NETHER_STAR(399, 0, 12469, "Nether Star"), + PUMPKIN_PIE(400, 0, 28725, "Pumpkin Pie"), + FIREWORK_ROCKET(401, 0, 23841, "Firework Rocket"), + FIREWORK_STAR(402, 0, 12190, "Firework Star", "FIREWORK_CHARGE"), + ENCHANTED_BOOK(403, 0, 11741, "Enchanted Book"), + COMPARATOR(404, 0, 18911, "Redstone Comparator"), + NETHER_BRICKS(405, 0, 27802, "Nether Brick", "Nether Bricks"), + QUARTZ(406, 0, 23608, "Nether Quartz"), + TNT_MINECART(407, 0, 4277, "Minecart with TNT", "explosiveminecart"), + HOPPER_MINECART(408, 0, 19024, "Minecart with Hopper"), + PRISMARINE_SHARD(409, 0, 10993, "Prismarine Shard"), + PRISMARINE_CRYSTALS(410, 0, 31546, "Prismarine Crystals"), + RABBIT(411, 0, 23068, "Raw Rabbit"), + COOKED_RABBIT(412, 0, 4454, "Cooked Rabbit"), + RABBIT_STEW(413, 0, 10611, "Rabbit Stew"), + RABBIT_FOOT(414, 0, 13864, "Rabbit's Foot"), + RABBIT_HIDE(415, 0, 12467, "Rabbit Hide"), + ARMOR_STAND(416, 0, 12852, "Armor Stand"), + IRON_HORSE_ARMOR(417, 0, 30108, "Iron Horse Armor", "Iron_barding"), + GOLDEN_HORSE_ARMOR(418, 0, 7996, "Golden Horse Armor", "gold_barding"), + DIAMOND_HORSE_ARMOR(419, 0, 10321, "Diamond Horse Armor", "Diamond_barding"), + LEAD(420, 0, 29539, "Lead", "Leash"), + NAME_TAG(421, 0, 30731, "Name Tag"), + COMMAND_BLOCK_MINECART(422, 0, 7992, "Minecart with Command Block"), + MUTTON(423, 0, 4792, "Raw Mutton"), + COOKED_MUTTON(424, 0, 31447, "Cooked Mutton"), + BLACK_BANNER(425, 0, 9365, "Banner", "Black Banner"), + END_CRYSTAL(426, 0, 19090, "End Crystal"), + SPRUCE_DOOR_ITEM(427, 0, -1, "Spruce Door", "SPRUCE_DOOR_ITEM"), + BIRCH_DOOR_ITEM(428, 0, -1, "Birch Door", "BIRCH_DOOR_ITEM"), + JUNGLE_DOOR_ITEM(429, 0, -1, "Jungle Door", "JUNGLE_DOOR_ITEM"), + ACACIA_DOOR_ITEM(430, 0, -1, "Acacia Door", "ACACIA_DOOR_ITEM"), + DARK_OAK_DOOR_ITEM(431, 0, -1, "Dark Oak Door", "DARK_OAK_DOOR_ITEM"), + CHORUS_FRUIT(432, 0, 7652, "Chorus Fruit"), + POPPED_CHORUS_FRUIT(433, 0, 16880, "Popped Chorus Fruit"), + BEETROOT(434, 0, 23305, "Beetroot"), + BEETROOT_SEEDS(435, 0, 21282, "Beetroot Seeds"), + BEETROOT_SOUP(436, 0, 16036, "Beetroot Soup"), + DRAGON_BREATH(437, 0, 20154, "Dragon's Breath"), + SPECTRAL_ARROW(439, 0, 4568, "Spectral Arrow"), + TIPPED_ARROW(440, 0, 25164, "Tipped Arrow"), + LINGERING_POTION(441, 0, 25857, "Lingering Potion"), + SHIELD(442, 0, 29943, "Shield"), + ELYTRA(443, 0, 23829, "Elytra"), + TOTEM_OF_UNDYING(449, 0, 10139, "Totem Of Undying"), + MUSIC_DISC_13(2256, 0, 16359, "13 Disc", "GOLD_RECORD"), + MUSIC_DISC_CAT(2257, 0, 16246, "Cat Disc", "GREEN_RECORD"), + MUSIC_DISC_BLOCKS(2258, 0, 26667, "Blocks Disc", "RECORD_3"), + MUSIC_DISC_CHIRP(2259, 0, 19436, "Chirp Disc", "RECORD_4"), + MUSIC_DISC_FAR(2260, 0, 13823, "Far Disc", "RECORD_5"), + MUSIC_DISC_MALL(2261, 0, 11517, "Mall Disc", "RECORD_6"), + MUSIC_DISC_MELLOHI(2262, 0, 26117, "Mellohi Disc", "RECORD_7"), + MUSIC_DISC_STAL(2263, 0, 14989, "Stal Disc", "RECORD_8"), + MUSIC_DISC_STRAD(2264, 0, 16785, "Strad Disc", "RECORD_9"), + MUSIC_DISC_WARD(2265, 0, 24026, "Ward Disc", "RECORD_10"), + MUSIC_DISC_11(2266, 0, 27426, "11 Disc", "RECORD_11"), + MUSIC_DISC_WAIT(2267, 0, 26499, "Wait Disc", "RECORD_12"), + PISTON_MOVING_PIECE(36, 0, -1, "Piston Moving Piece"), + CROPS(59, 0, -1, "Crops"), + BURNING_FURNACE(62, 0, -1, "Burning Furnace"), + SIGN_POST(63, 0, -1, "Sign Post"), + WOODEN_DOOR(64, 0, -1, "Wooden Door"), + GLOWING_REDSTONE_ORE(74, 0, -1, "Glowing Redstone Ore"), + SUGAR_CANE_BLOCK(83, 0, -1, "Sugar Cane Block"), + DIODE_BLOCK_OFF(93, 0, -1, "Diode Block Off"), + DIODE_BLOCK_ON(94, 0, -1, "Diode Block On"), + REDSTONE_LAMP_ON(124, 0, -1, "Redstone Lamp On"), + WOOD_DOUBLE_STEP(125, 0, -1, "Wood Step Double"), + SKULL(144, 0, -1, "Skull"), + REDSTONE_COMPARATOR_OFF(149, 0, -1, "Redstone Comparator Off"), + REDSTONE_COMPARATOR_ON(150, 0, -1, "Redstone Comparator Off"), + STANDING_BANNER(176, 0, -1, "Standing Banner"), + WALL_BANNER(177, 0, -1, "Wall Banner"), + DAYLIGHT_DETECTOR_INVERTED(178, 0, -1, "Daylight Detector Inverted"), + DOUBLE_STONE_SLAB2(181, 0, -1, "Double Stone Slab2"), + PURPUR_DOUBLE_SLAB(204, 0, -1, "Purpur Ddouble Slab"), + COMMAND_REPEATING(210, 0, -1, "Repeating Command Block"), + COMMAND_CHAIN(211, 0, -1, "Chain Command Block"), + + // 1.13 + + ACACIA_BOAT(447, 0, 27326, "Acacia Boat", "BOAT_ACACIA"), + ACACIA_BUTTON(-1, -1, 13993, "Acacia Button", ""), + ACACIA_DOOR(196, 0, 23797, "Acacia Door", "ACACIA_DOOR"), + ACACIA_FENCE(192, 0, 4569, "Acacia Fence", "ACACIA_FENCE"), + ACACIA_FENCE_GATE(187, 0, 14145, "Acacia Fence Gate", "ACACIA_FENCE_GATE"), + ACACIA_LEAVES(161, 0, 16606, "Acacia Leaves", "LEAVES_2"), + ACACIA_LOG(162, 0, 8385, "Acacia Log", "LOG_2"), + ACACIA_PRESSURE_PLATE(-1, -1, 17586, "Acacia Pressure Plate", ""), + ACACIA_STAIRS(163, 0, 17453, "Acacia Stairs", "ACACIA_STAIRS"), + ACACIA_TRAPDOOR(-1, -1, 18343, "Acacia Trapdoor", ""), + ACACIA_WOOD(162, 0, 21861, "Acacia Wood", ""), + ACTIVATOR_RAIL(157, 0, 5834, "Activator Rail", "ACTIVATOR_RAIL"), + ALLIUM(38, 2, 6871, "Allium", "RED_ROSE"), + ANVIL(145, 0, 18718, "Anvil", "ANVIL"), + APPLE(260, 0, 7720, "Apple", "APPLE"), + ARROW(262, 0, 31091, "Arrow", "ARROW"), + ATTACHED_MELON_STEM(-1, -1, 30882, "Attached Melon Stem", ""), + ATTACHED_PUMPKIN_STEM(-1, -1, 12724, "Attached Pumpkin Stem", ""), + AZURE_BLUET(38, 3, 17608, "Azure Bluet", ""), + BARRIER(166, 0, 26453, "Barrier", "BARRIER"), + BEACON(138, 0, 6608, "Beacon", "BEACON"), + BED_BLOCK(26, 0, 23130, "Bed Block"), + BEDROCK(7, 0, 23130, "Bedrock", "BEDROCK"), + BEETROOTS(207, 0, 22075, "Beetroots", "BEETROOT_BLOCK"), + BIRCH_BOAT(445, 0, 28104, "Birch Boat", "BOAT_BIRCH"), + BIRCH_BUTTON(-1, -1, 26934, "Birch Button", ""), + BIRCH_DOOR(194, 0, 14759, "Birch Door", "BIRCH_DOOR"), + BIRCH_FENCE(189, 0, 17347, "Birch Fence", "BIRCH_FENCE"), + BIRCH_FENCE_GATE(184, 0, 6322, "Birch Fence Gate", "BIRCH_FENCE_GATE"), + BIRCH_LEAVES(18, 2, 12601, "Birch Leaves", "LEAVES"), + BIRCH_LOG(17, 2, 26727, "Birch Log", "LOG"), + BIRCH_PRESSURE_PLATE(-1, -1, 9664, "Birch Pressure Plate", ""), + BIRCH_SLAB(126, 2, 13807, "Birch Slab", ""), + BIRCH_TRAPDOOR(-1, -1, 32585, "Birch Trapdoor", ""), + BIRCH_WOOD(17, 2, 7924, "Birch Wood", ""), + BLACK_CARPET(171, 15, 6056, "Black Carpet", "CARPET"), + BLACK_CONCRETE(251, 15, 13338, "Black Concrete", "CONCRETE"), + BLACK_CONCRETE_POWDER(252, 15, 16150, "Black Concrete Powder", "CONCRETE_POWDER"), + BLACK_GLAZED_TERRACOTTA(250, 0, 29678, "Black Glazed Terracotta", "BLACK_GLAZED_TERRACOTTA"), + BLACK_SHULKER_BOX(234, 0, 24076, "Black Shulker Box", "BLACK_SHULKER_BOX"), + BLACK_STAINED_GLASS(95, 15, 13941, "Black Stained Glass", "STAINED_GLASS"), + BLACK_STAINED_GLASS_PANE(160, 15, 13201, "Black Stained Glass Pane", "STAINED_GLASS_PANE"), + BLACK_TERRACOTTA(159, 15, 26691, "Black Terracotta", "STAINED_CLAY"), + BLACK_WALL_BANNER(425, -1, 4919, "Black Banner", ""), + BLACK_WOOL(35, 15, 16693, "Black Wool", ""), + BLUE_BANNER(245, 4, 18481, "Blue Banner", "PURPLE_GLAZED_TERRACOTTA"), + BLUE_CARPET(171, 11, 13292, "Blue Carpet", ""), + BLUE_CONCRETE(251, 11, 18756, "Blue Concrete", ""), + BLUE_CONCRETE_POWDER(252, 11, 17773, "Blue Concrete Powder", ""), + BLUE_GLAZED_TERRACOTTA(246, 0, 23823, "Blue Glazed Terracotta", "BLUE_GLAZED_TERRACOTTA"), + BLUE_ICE(-1, -1, 22449, "Blue Ice", ""), + BLUE_ORCHID(38, 1, 13432, "Blue Orchid", ""), + BLUE_SHULKER_BOX(230, 0, 11476, "Blue Shulker Box", "BLUE_SHULKER_BOX"), + BLUE_STAINED_GLASS(95, 11, 7107, "Blue Stained Glass", ""), + BLUE_STAINED_GLASS_PANE(160, 11, 28484, "Blue Stained Glass Pane", ""), + BLUE_TERRACOTTA(159, 11, 5236, "Blue Terracotta", ""), + BLUE_WALL_BANNER(425, -1, 17757, "Blue Banner", ""), + BLUE_WOOL(35, 11, 15738, "Blue Wool", ""), + BONE_BLOCK(216, 0, 17312, "Bone Block", "BONE_BLOCK"), + BOOKSHELF(47, 0, 10069, "Bookshelf", "BOOKSHELF"), + BOW(261, 0, 8745, "Bow", "BOW"), + BOWL(281, 0, 32661, "Bowl", "BOWL"), + BRAIN_CORAL(-1, -1, 31316, "Brain Coral", ""), + BRAIN_CORAL_BLOCK(-1, -1, 30618, "Brain Coral Block", ""), + BRAIN_CORAL_FAN(-1, -1, 13849, "Brain Coral Fan", ""), + BREAD(297, 0, 32049, "Bread", "BREAD"), + BREWING_STAND(117, 0, 14539, "Brewing Stand", "BREWING_STAND"), + BRICKS(45, 0, 14165, "Bricks", "BRICK"), + BRICK_SLAB(44, 4, 26333, "Brick Slab", "STEP"), + BRICK_STAIRS(108, 0, 21534, "Brick Stairs", "BRICK_STAIRS"), + BROWN_BANNER(425, 3, 11481, "Brown Banner", ""), + BROWN_CARPET(171, 12, 23352, "Brown Carpet", ""), + BROWN_CONCRETE(251, 12, 19006, "Brown Concrete", ""), + BROWN_CONCRETE_POWDER(252, 12, 21485, "Brown Concrete Powder", ""), + BROWN_GLAZED_TERRACOTTA(247, 0, 5655, "Brown Glazed Terracotta", "BROWN_GLAZED_TERRACOTTA"), + BROWN_MUSHROOM(39, 0, 9665, "Brown Mushroom", "BROWN_MUSHROOM"), + BROWN_MUSHROOM_BLOCK(99, 0, 6291, "Brown Mushroom Block", "HUGE_MUSHROOM_1"), + BROWN_SHULKER_BOX(231, 0, 24230, "Brown Shulker Box", "BROWN_SHULKER_BOX"), + BROWN_STAINED_GLASS(95, 12, 20945, "Brown Stained Glass", ""), + BROWN_STAINED_GLASS_PANE(160, 12, 17557, "Brown Stained Glass Pane", ""), + BROWN_TERRACOTTA(159, 12, 23664, "Brown Terracotta", ""), + BROWN_WALL_BANNER(425, -1, 14731, "Brown Banner", ""), + BROWN_WOOL(35, 12, 32638, "Brown Wool", ""), + BUBBLE_COLUMN(-1, -1, 13758, "Bubble Column", ""), + BUBBLE_CORAL(-1, -1, 12464, "Bubble Coral", ""), + BUBBLE_CORAL_BLOCK(-1, -1, 15437, "Bubble Coral Block", ""), + BUBBLE_CORAL_FAN(-1, -1, 10795, "Bubble Coral Fan", ""), + CACTUS(81, 0, 12191, "Cactus", "CACTUS"), + CAKE_BLOCK(92, 0, 27048, "Cake block", "CAKE_BLOCK"), + CARROTS(141, 0, 17258, "Carrots", "CARROT"), + CARVED_PUMPKIN(-1, -1, 25833, "Carved Pumpkin", ""), + CAULDRON(118, 0, 26531, "Cauldron", "CAULDRON"), + CAVE_AIR(0, 0, 17422, "Air", ""), + CHAINMAIL_CHESTPLATE(303, 0, 23602, "Chainmail Chestplate", "CHAINMAIL_CHESTPLATE"), + CHAINMAIL_HELMET(302, 0, 26114, "Chainmail Helmet", "CHAINMAIL_HELMET"), + CHAINMAIL_LEGGINGS(304, 0, 19087, "Chainmail Leggings", "CHAINMAIL_LEGGINGS"), + CHAIN_COMMAND_BLOCK(-1, -1, 26798, "Chain Command Block", ""), + CHARCOAL(263, 1, 5390, "Charcoal", "COAL"), + CHEST(54, 0, 22969, "Chest", "CHEST"), + CHIPPED_ANVIL(145, 1, 10623, "Chipped Anvil", ""), + CHISELED_QUARTZ_BLOCK(155, 1, 30964, "Chiseled Quartz Block", "QUARTZ_BLOCK"), + CHISELED_RED_SANDSTONE(179, 1, 15529, "Chiseled Red Sandstone", "RED_SANDSTONE"), + CHISELED_SANDSTONE(24, 1, 31763, "Chiseled Sandstone", "SANDSTONE"), + CHISELED_STONE_BRICKS(98, 3, 9087, "Chiseled Stone Bricks", "SMOOTH_BRICK"), + CHORUS_FLOWER(200, 0, 28542, "Chorus Flower", "CHORUS_FLOWER"), + CHORUS_PLANT(199, 0, 28243, "Chorus Plant", "CHORUS_PLANT"), + CLAY(82, 0, 27880, "Clay", "CLAY"), + COAL(263, 0, 29067, "Coal", ""), + COAL_BLOCK(173, 0, 27968, "Block of Coal", "COAL_BLOCK"), + COAL_ORE(16, 0, 30965, "Coal Ore", "COAL_ORE"), + COBBLESTONE_SLAB(44, 3, 6340, "Cobblestone Slab", ""), + COBBLESTONE_STAIRS(67, 0, 24715, "Cobblestone Stairs", "COBBLESTONE_STAIRS"), + COBBLESTONE_WALL(139, 0, 12616, "Cobblestone Wall", "COBBLE_WALL"), + COBWEB(30, 0, 9469, "Cobweb", "WEB"), + COCOA_BEANS(-1, -1, 27381, "Cocoa Beans", ""), + COD(-1, -1, 24691, "Raw Cod", "rawfish"), + COD_BUCKET(-1, -1, 28601, "Bucket of Cod", ""), + COD_SPAWN_EGG(-1, -1, 27248, "Cod Spawn Egg", ""), + COMMAND_BLOCK(137, 0, 4355, "Command Block", "COMMAND"), + CONDUIT(-1, -1, 5148, "Conduit", ""), + COOKED_COD(-1, -1, 9681, "Cooked Cod", ""), + CRACKED_STONE_BRICKS(98, 2, 27869, "Cracked Stone Bricks", ""), + CRAFTING_TABLE(58, 0, 20706, "Crafting Table", "WORKBENCH"), + CREEPER_WALL_HEAD(397, -1, 30123, "Creeper Wall Head", ""), + CUT_RED_SANDSTONE(-1, -1, 26842, "Cut Red Sandstone", ""), + CUT_SANDSTONE(-1, -1, 6118, "Cut Sandstone", ""), + CYAN_BANNER(425, 6, 9839, "Cyan Banner", ""), + CYAN_CARPET(171, 9, 31495, "Cyan Carpet", ""), + CYAN_CONCRETE(251, 9, 26522, "Cyan Concrete", ""), + CYAN_CONCRETE_POWDER(252, 9, 15734, "Cyan Concrete Powder", ""), + CYAN_GLAZED_TERRACOTTA(244, 0, 9550, "Cyan Glazed Terracotta", "CYAN_GLAZED_TERRACOTTA"), + CYAN_SHULKER_BOX(228, 0, 28123, "Cyan Shulker Box", "CYAN_SHULKER_BOX"), + CYAN_STAINED_GLASS(95, 9, 30604, "Cyan Stained Glass", ""), + CYAN_STAINED_GLASS_PANE(160, 9, 11784, "Cyan Stained Glass Pane", ""), + CYAN_TERRACOTTA(159, 9, 25940, "Cyan Terracotta", ""), + CYAN_WALL_BANNER(425, -1, 10889, "Cyan Banner", ""), + CYAN_WOOL(35, 9, 12221, "Cyan Wool", ""), + DAMAGED_ANVIL(145, 2, 10274, "Damaged Anvil", ""), + DANDELION(37, 0, 30558, "Dandelion", "YELLOW_FLOWER"), + DARK_OAK_BOAT(448, 0, 28618, "Dark Oak Boat", "BOAT_DARK_OAK"), + DARK_OAK_BUTTON(-1, -1, 6214, "Dark Oak Button", ""), + DARK_OAK_DOOR(197, 0, 10669, "Dark Oak Door", "DARK_OAK_DOOR"), + DARK_OAK_FENCE(191, 0, 21767, "Dark Oak Fence", "DARK_OAK_FENCE"), + DARK_OAK_FENCE_GATE(186, 0, 10679, "Dark Oak Fence Gate", "DARK_OAK_FENCE_GATE"), + DARK_OAK_LEAVES(161, 1, 22254, "Dark Oak Leaves", ""), + DARK_OAK_LOG(162, 1, 14831, "Dark Oak Log", ""), + DARK_OAK_PRESSURE_PLATE(-1, -1, 31375, "Dark Oak Pressure Plate", ""), + DARK_OAK_SAPLING(6, 5, 14933, "Dark Oak Sapling", ""), + DARK_OAK_STAIRS(164, 0, 22921, "Dark Oak Stairs", "DARK_OAK_STAIRS"), + DARK_OAK_TRAPDOOR(-1, -1, 10355, "Dark Oak Trapdoor", ""), + DARK_OAK_WOOD(162, 1, 7871, "Dark Oak Wood", ""), + DARK_PRISMARINE(168, 2, 19940, "Dark Prismarine", "PRISMARINE"), + DARK_PRISMARINE_SLAB(-1, -1, 7577, "Dark Prismarine Slab", ""), + DARK_PRISMARINE_STAIRS(-1, -1, 26511, "Dark Prismarine Stairs", ""), + DAYLIGHT_DETECTOR(151, 0, 8864, "Daylight Detector", "DAYLIGHT_DETECTOR"), + DEAD_BRAIN_CORAL_BLOCK(-1, -1, 12979, "Dead Brain Coral Block", ""), + DEAD_BUBBLE_CORAL_BLOCK(-1, -1, 28220, "Dead Bubble Coral Block", ""), + DEAD_BUSH(32, 0, 22888, "Dead Bush", "DEAD_BUSH"), + DEAD_FIRE_CORAL_BLOCK(-1, -1, 5307, "Dead Fire Coral Block", ""), + DEAD_HORN_CORAL_BLOCK(-1, -1, 15103, "Dead Horn Coral Block", ""), + DEAD_TUBE_CORAL_BLOCK(-1, -1, 28350, "Dead Tube Coral Block", ""), + DEBUG_STICK(-1, -1, 24562, "Debug Stick", ""), + DETECTOR_RAIL(28, 0, 13475, "Detector Rail", "DETECTOR_RAIL"), + DIAMOND(264, 0, 20865, "Diamond", "DIAMOND"), + DIAMOND_AXE(279, 0, 27277, "Diamond Axe", "DIAMOND_AXE"), + DIAMOND_BLOCK(57, 0, 5944, "Block of Diamond", "DIAMOND_BLOCK"), + DIAMOND_HOE(293, 0, 24050, "Diamond Hoe", "DIAMOND_HOE"), + DIAMOND_ORE(56, 0, 9292, "Diamond Ore", "DIAMOND_ORE"), + DIAMOND_PICKAXE(278, 0, 24291, "Diamond Pickaxe", "DIAMOND_PICKAXE"), + DIAMOND_SHOVEL(277, 0, 25415, "Diamond Shovel", "DIAMOND_SPADE"), + DIAMOND_SWORD(276, 0, 27707, "Diamond Sword", "DIAMOND_SWORD"), + DISPENSER(23, 0, 20871, "Dispenser", "DISPENSER"), + DOLPHIN_SPAWN_EGG(-1, -1, 20787, "Dolphin Spawn Egg", ""), + DRAGON_EGG(122, 0, 29946, "Dragon Egg", "DRAGON_EGG"), + DRAGON_HEAD(397, 5, 20084, "Dragon Head", ""), + DRAGON_WALL_HEAD(-1, -1, 19818, "Dragon Wall Head", ""), + DRIED_KELP(-1, -1, 21042, "Dried Kelp", ""), + DRIED_KELP_BLOCK(-1, -1, 12966, "Dried Kelp Block", ""), + DROPPER(158, 0, 31273, "Dropper", "DROPPER"), + DROWNED_SPAWN_EGG(-1, -1, 19368, "Drowned Spawn Egg", ""), + DOUBLE_STONE_SLAB(43, 0, 19117, "Double Stone Slab"), + DOUBLE_SANDSTONE_SLAB(43, 1, 19117, "Double Sandstone Slab"), + DOUBLE_WOODEN_SLAB(43, 2, 19117, "Double Wooden Slab"), + DOUBLE_COBBLESTONE_SLAB(43, 3, 19117, "Double Cobblestone Slab"), + DOUBLE_BRICK_SLAB(43, 4, 19117, "Double Brick Slab"), + DOUBLE_STONE_BRICK_SLAB(43, 5, 19117, "Double Stone Brick Slab"), + DOUBLE_NETHER_BRICK_SLAB(43, 6, 19117, "Double Nether Brick Slab"), + DOUBLE_QUARTZ_SLAB(43, 7, 19117, "Double Quartz Slab"), + ENCHANTING_TABLE(116, 0, 16255, "Enchanting Table", "ENCHANTMENT_TABLE"), + END_GATEWAY(209, 0, 26605, "End Gateway", "END_GATEWAY"), + END_PORTAL(119, 0, 16782, "End Portal", "ENDER_PORTAL"), + END_PORTAL_FRAME(120, 0, 15480, "End Portal Frame", "ENDER_PORTAL_FRAME"), + END_ROD(198, 0, 24832, "End Rod", "END_ROD"), + END_STONE(121, 0, 29686, "End Stone", "ENDER_STONE"), + END_STONE_BRICKS(206, 0, 20314, "End Stone Bricks", "END_BRICKS"), + FARMLAND(60, 0, 31166, "Farmland", "SOIL"), + FEATHER(288, 0, 30548, "Feather", "FEATHER"), + FERN(31, 2, 15794, "Fern", "LONG_GRASS"), + FIRE(51, 0, 16396, "Fire", "FIRE"), + FIRE_CORAL(-1, -1, 29151, "Fire Coral", ""), + FIRE_CORAL_BLOCK(-1, -1, 12119, "Fire Coral Block", ""), + FIRE_CORAL_FAN(-1, -1, 11112, "Fire Coral Fan", ""), + FLINT_AND_STEEL(259, 0, 28620, "Flint and Steel", "FLINT_AND_STEEL"), + FLOWER_POT(140, 0, 30567, "Flower Pot", "FLOWER_POT"), + FROSTED_ICE(212, 0, 21814, "Frosted Ice", "FROSTED_ICE"), + FURNACE(61, 0, 8133, "Furnace", "FURNACE"), + GLASS(20, 0, 6195, "Glass", "GLASS"), + GLASS_PANE(102, 0, 5709, "Glass Pane", "THIN_GLASS"), + GLOWSTONE(89, 0, 32713, "Glowstone", "GLOWSTONE"), + GOLDEN_AXE(286, 0, 4878, "Golden Axe", "GOLD_AXE"), + GOLDEN_HOE(294, 0, 19337, "Golden Hoe", "GOLD_HOE"), + GOLDEN_PICKAXE(285, 0, 10901, "Golden Pickaxe", "GOLD_PICKAXE"), + GOLDEN_SHOVEL(284, 0, 15597, "Golden Shovel", "GOLD_SPADE"), + GOLDEN_SWORD(283, 0, 10505, "Golden Sword", "GOLD_SWORD"), + GOLD_BLOCK(41, 0, 27392, "Block of Gold", "GOLD_BLOCK"), + GOLD_INGOT(266, 0, 28927, "Gold Ingot", "GOLD_INGOT"), + GOLD_ORE(14, 0, 32625, "Gold Ore", "GOLD_ORE"), + GRASS(31, 1, 6155, "Grass", ""), + GRASS_PATH(208, 0, 8604, "Grass Path", "GRASS_PATH"), + GRAVEL(13, 0, 7804, "Gravel", "GRAVEL"), + GRAY_BANNER(425, 8, 12053, "Gray Banner", ""), + GRAY_CARPET(171, 7, 26991, "Gray Carpet", ""), + GRAY_CONCRETE(251, 7, 13959, "Gray Concrete", ""), + GRAY_CONCRETE_POWDER(252, 7, 13031, "Gray Concrete Powder", ""), + GRAY_GLAZED_TERRACOTTA(242, 0, 6256, "Gray Glazed Terracotta", "GRAY_GLAZED_TERRACOTTA"), + GRAY_SHULKER_BOX(226, 0, 12754, "Gray Shulker Box", "GRAY_SHULKER_BOX"), + GRAY_STAINED_GLASS(95, 7, 29979, "Gray Stained Glass", ""), + GRAY_STAINED_GLASS_PANE(160, 7, 25272, "Gray Stained Glass Pane", ""), + GRAY_TERRACOTTA(159, 7, 18004, "Gray Terracotta", ""), + GRAY_WALL_BANNER(425, -1, 24275, "Gray Banner", ""), + GRAY_WOOL(35, 7, 27209, "Gray Wool", ""), + GREEN_BANNER(425, 2, 10698, "Green Banner", ""), + GREEN_CARPET(171, 13, 7780, "Green Carpet", ""), + GREEN_CONCRETE(251, 13, 17949, "Green Concrete", ""), + GREEN_CONCRETE_POWDER(252, 13, 6904, "Green Concrete Powder", ""), + GREEN_GLAZED_TERRACOTTA(248, 0, 6958, "Green Glazed Terracotta", "GREEN_GLAZED_TERRACOTTA"), + GREEN_SHULKER_BOX(232, 0, 9377, "Green Shulker Box", "GREEN_SHULKER_BOX"), + GREEN_STAINED_GLASS(95, 13, 22503, "Green Stained Glass", ""), + GREEN_STAINED_GLASS_PANE(160, 13, 4767, "Green Stained Glass Pane", ""), + GREEN_TERRACOTTA(159, 13, 4105, "Green Terracotta", ""), + GREEN_WALL_BANNER(425, -1, 15046, "Green Banner", ""), + GREEN_WOOL(35, 13, 25085, "Green Wool", ""), + GUNPOWDER(289, 0, 29974, "Gunpowder", "SULPHUR"), + HAY_BLOCK(170, 0, 17461, "Hay Bale", "HAY_BLOCK"), + HEART_OF_THE_SEA(-1, -1, 11807, "Heart of the Sea", ""), + HEAVY_WEIGHTED_PRESSURE_PLATE(148, 0, 16970, "Heavy Weighted Pressure Plate", "IRON_PLATE"), + HOPPER(154, 0, 31974, "Hopper", "HOPPER"), + HORN_CORAL(-1, -1, 19511, "Horn Coral", ""), + HORN_CORAL_BLOCK(-1, -1, 19958, "Horn Coral Block", ""), + HORN_CORAL_FAN(-1, -1, 13610, "Horn Coral Fan", ""), + ICE(79, 0, 30428, "Ice", "ICE"), + INFESTED_CHISELED_STONE_BRICKS(97, 5, 4728, "Infested Chiseled Stone Bricks", "MONSTER_EGGS"), + INFESTED_COBBLESTONE(97, 1, 28798, "Infested Cobblestone", ""), + INFESTED_CRACKED_STONE_BRICKS(97, 4, 7476, "Infested Cracked Stone Bricks", ""), + INFESTED_MOSSY_STONE_BRICKS(97, 3, 9850, "Infested Mossy Stone Bricks", ""), + INFESTED_STONE(97, 0, 18440, "Infested Stone", ""), + INFESTED_STONE_BRICKS(97, 2, 19749, "Infested Stone Bricks", ""), + IRON_AXE(258, 0, 15894, "Iron Axe", "IRON_AXE"), + IRON_BARS(101, 0, 9378, "Iron Bars", "IRON_FENCE"), + IRON_BLOCK(42, 0, 24754, "Block of Iron", "IRON_BLOCK"), + IRON_DOOR_BLOCK(71, 0, 4788, "Iron Door Block", "IRON_DOOR_BLOCK"), + IRON_HOE(292, 0, 11339, "Iron Hoe", "IRON_HOE"), + IRON_INGOT(265, 0, 24895, "Iron Ingot", "IRON_INGOT"), + IRON_NUGGET(452, 0, 13715, "Iron Nugget", ""), + IRON_ORE(15, 0, 19834, "Iron Ore", "IRON_ORE"), + IRON_PICKAXE(257, 0, 8842, "Iron Pickaxe", "IRON_PICKAXE"), + IRON_SHOVEL(256, 0, 30045, "Iron Shovel", "IRON_SPADE"), + IRON_SWORD(267, 0, 10904, "Iron Sword", "IRON_SWORD"), + IRON_TRAPDOOR(167, 0, 17095, "Iron Trapdoor", "IRON_TRAPDOOR"), + JACK_O_LANTERN(91, 0, 31612, "Jack o'Lantern", "JACK_O_LANTERN"), + JUKEBOX(84, 0, 19264, "Jukebox", "JUKEBOX"), + JUNGLE_BOAT(446, 0, 4495, "Jungle Boat", "BOAT_JUNGLE"), + JUNGLE_BUTTON(-1, -1, 25317, "Jungle Button", ""), + JUNGLE_DOOR(195, 0, 28163, "Jungle Door", "JUNGLE_DOOR"), + JUNGLE_FENCE(190, 0, 14358, "Jungle Fence", "JUNGLE_FENCE"), + JUNGLE_FENCE_GATE(185, 0, 21360, "Jungle Fence Gate", "JUNGLE_FENCE_GATE"), + JUNGLE_LEAVES(18, 3, 5133, "Jungle Leaves", ""), + JUNGLE_LOG(17, 3, 20721, "Jungle Log", ""), + JUNGLE_PRESSURE_PLATE(-1, -1, 11376, "Jungle Pressure Plate", ""), + JUNGLE_SLAB(126, 3, 19117, "Jungle Slab", ""), + JUNGLE_TRAPDOOR(-1, -1, 8626, "Jungle Trapdoor", ""), + JUNGLE_WOOD(17, 3, 30228, "Jungle Wood", ""), + KELP(-1, -1, 21916, "Kelp", ""), + KELP_PLANT(-1, -1, 29697, "Kelp Plant", ""), + KNOWLEDGE_BOOK(453, 0, 12646, "Knowledge Book", ""), + LADDER(65, 0, 23599, "Ladder", "LADDER"), + LAPIS_BLOCK(22, 0, 14485, "Lapis Lazuli Block", "LAPIS_BLOCK"), + LAPIS_ORE(21, 0, 22934, "Lapis Lazuli Ore", "LAPIS_ORE"), + LARGE_FERN(175, 3, 30177, "Large Fern", "DOUBLE_PLANT"), + FLOWING_LAVA(10, 0, 8415, "Flowing Lava", "FLOWING_LAVA"), + LAVA(11, 0, 8415, "Lava", "STATIONARY_LAVA"), + LEATHER_BOOTS(301, 0, 15282, "Leather Boots", "LEATHER_BOOTS"), + LEATHER_CHESTPLATE(299, 0, 29275, "Leather Tunic", "LEATHER_CHESTPLATE"), + LEATHER_HELMET(298, 0, 11624, "Leather Cap", "LEATHER_HELMET"), + LEATHER_LEGGINGS(300, 0, 28210, "Leather Pants", "LEATHER_LEGGINGS"), + LEVER(69, 0, 15319, "Lever", "LEVER"), + LIGHT_BLUE_BANNER(425, 12, 18060, "Light Blue Banner", ""), + LIGHT_BLUE_CARPET(171, 3, 21194, "Light Blue Carpet", ""), + LIGHT_BLUE_CONCRETE(251, 3, 29481, "Light Blue Concrete", ""), + LIGHT_BLUE_CONCRETE_POWDER(252, 3, 31206, "Light Blue Concrete Powder", ""), + LIGHT_BLUE_GLAZED_TERRACOTTA(238, 0, 4336, "Light Blue Glazed Terracotta", "LIGHT_BLUE_GLAZED_TERRACOTTA"), + LIGHT_BLUE_SHULKER_BOX(222, 0, 18226, "Light Blue Shulker Box", "LIGHT_BLUE_SHULKER_BOX"), + LIGHT_BLUE_STAINED_GLASS(95, 3, 17162, "Light Blue Stained Glass", ""), + LIGHT_BLUE_STAINED_GLASS_PANE(160, 3, 18721, "Light Blue Stained Glass Pane", ""), + LIGHT_BLUE_TERRACOTTA(159, 3, 31779, "Light Blue Terracotta", ""), + LIGHT_BLUE_WALL_BANNER(425, -1, 12011, "Light Blue Banner", ""), + LIGHT_BLUE_WOOL(35, 3, 21073, "Light Blue Wool", ""), + LIGHT_GRAY_BANNER(425, -1, 11417, "Light Gray Banner", ""), + LIGHT_GRAY_CARPET(171, 8, 11317, "Light Gray Carpet", ""), + LIGHT_GRAY_CONCRETE(251, 8, 14453, "Light Gray Concrete", ""), + LIGHT_GRAY_CONCRETE_POWDER(252, 8, 21589, "Light Gray Concrete Powder", ""), + LIGHT_GRAY_GLAZED_TERRACOTTA(243, 0, 10707, "Light Gray Glazed Terracotta", "SILVER_GLAZED_TERRACOTTA"), + LIGHT_GRAY_SHULKER_BOX(227, 0, 21345, "Light Gray Shulker Box", "SILVER_SHULKER_BOX"), + LIGHT_GRAY_STAINED_GLASS(95, 8, 5843, "Light Gray Stained Glass", ""), + LIGHT_GRAY_STAINED_GLASS_PANE(160, 8, 19008, "Light Gray Stained Glass Pane", ""), + LIGHT_GRAY_TERRACOTTA(159, 8, 26388, "Light Gray Terracotta", ""), + LIGHT_GRAY_WALL_BANNER(425, -1, 31088, "Light Gray Banner", ""), + LIGHT_GRAY_WOOL(35, 8, 22936, "Light Gray Wool", ""), + LIGHT_WEIGHTED_PRESSURE_PLATE(147, 0, 14875, "Light Weighted Pressure Plate", "GOLD_PLATE"), + LILAC(175, 1, 22837, "Lilac", ""), + LILY_PAD(111, 0, 19271, "Lily Pad", "WATER_LILY"), + LIME_BANNER(425, 10, 18887, "Lime Banner", ""), + LIME_CARPET(171, 5, 15443, "Lime Carpet", ""), + LIME_CONCRETE(251, 5, 5863, "Lime Concrete", ""), + LIME_CONCRETE_POWDER(252, 5, 28859, "Lime Concrete Powder", ""), + LIME_GLAZED_TERRACOTTA(240, 0, 13861, "Lime Glazed Terracotta", "LIME_GLAZED_TERRACOTTA"), + LIME_SHULKER_BOX(224, 0, 28360, "Lime Shulker Box", "LIME_SHULKER_BOX"), + LIME_STAINED_GLASS(95, 5, 24266, "Lime Stained Glass", ""), + LIME_STAINED_GLASS_PANE(160, 5, 10610, "Lime Stained Glass Pane", ""), + LIME_TERRACOTTA(159, 5, 24013, "Lime Terracotta", ""), + LIME_WALL_BANNER(425, -1, 21422, "Lime Banner", ""), + LIME_WOOL(35, 5, 10443, "Lime Wool", ""), + MAGENTA_BANNER(425, 13, 15591, "Magenta Banner", ""), + MAGENTA_CARPET(171, 2, 6180, "Magenta Carpet", ""), + MAGENTA_CONCRETE(251, 2, 20591, "Magenta Concrete", ""), + MAGENTA_CONCRETE_POWDER(252, 2, 8272, "Magenta Concrete Powder", ""), + MAGENTA_GLAZED_TERRACOTTA(237, 0, 8067, "Magenta Glazed Terracotta", "MAGENTA_GLAZED_TERRACOTTA"), + MAGENTA_SHULKER_BOX(221, 0, 21566, "Magenta Shulker Box", "MAGENTA_SHULKER_BOX"), + MAGENTA_STAINED_GLASS(95, 2, 26814, "Magenta Stained Glass", ""), + MAGENTA_STAINED_GLASS_PANE(160, 2, 14082, "Magenta Stained Glass Pane", ""), + MAGENTA_TERRACOTTA(159, 2, 25900, "Magenta Terracotta", ""), + MAGENTA_WALL_BANNER(425, -1, 23291, "Magenta Banner", ""), + MAGENTA_WOOL(35, 2, 11853, "Magenta Wool", ""), + MAGMA_BLOCK(213, 0, 25927, "Magma Block", "MAGMA"), + MAP(358, 0, 21655, "Empty Map"), + MELON(103, 0, 25172, "Melon", "Melon_Block"), + MELON_STEM(105, 0, 8247, "Melon Stem", "MELON_STEM"), + MOSSY_COBBLESTONE(48, 0, 21900, "Mossy Cobblestone", "MOSSY_COBBLESTONE"), + MOSSY_COBBLESTONE_WALL(139, 1, 11536, "Mossy Cobblestone Wall", ""), + MOSSY_STONE_BRICKS(98, 1, 16415, "Mossy Stone Bricks", ""), + MOVING_PISTON(-1, -1, 13831, "Moving Piston", ""), + MUSHROOM_STEM(-1, -1, 16543, "Mushroom Stem", ""), + MUSHROOM_STEW(282, 0, 16336, "Mushroom Stew", "MUSHROOM_SOUP"), + MYCELIUM(110, 0, 9913, "Mycelium", "MYCEL"), + NAUTILUS_SHELL(-1, -1, 19989, "Nautilus Shell", ""), + NETHERRACK(87, 0, 23425, "Netherrack", "NETHERRACK"), + NETHER_BRICK(112, 0, 19996, "Nether Brick", "NETHER_BRICK"), + NETHER_BRICK_FENCE(113, 0, 5286, "Nether Brick Fence", "NETHER_FENCE"), + NETHER_BRICK_SLAB(44, 6, 26586, "Nether Brick Slab", ""), + NETHER_BRICK_STAIRS(114, 0, 12085, "Nether Brick Stairs", "NETHER_BRICK_STAIRS"), + NETHER_PORTAL(90, 0, 19085, "Nether Portal", "PORTAL"), + NETHER_QUARTZ_ORE(153, 0, 4807, "Nether Quartz Ore", "QUARTZ_ORE"), + NETHER_WART(115, 0, 29227, "Nether Wart", "NETHER_WARTS"), + NETHER_WART_BLOCK(214, 0, 15486, "Nether Wart Block", "NETHER_WART_BLOCK"), + NOTE_BLOCK(25, 0, 20979, "Note Block", "NOTE_BLOCK"), + OAK_BUTTON(143, 0, 13510, "Oak Button", "Wooden_button"), + OAK_FENCE(85, 0, 6442, "Oak Fence", "FENCE"), + OAK_FENCE_GATE(107, 0, 16689, "Oak Fence Gate", "FENCE_GATE"), + OAK_LEAVES(18, 0, 4385, "Oak Leaves", ""), + OAK_LOG(17, 0, 26723, "Oak Log", ""), + OAK_PRESSURE_PLATE(72, 0, 20108, "Oak Pressure Plate", "Wooden_Presure_Plate"), + OAK_SLAB(126, 0, 12002, "Oak Slab", "Wood step"), + OAK_STAIRS(53, 0, 5449, "Oak Stairs", "WOOD_STAIRS"), + OAK_TRAPDOOR(96, 0, 16927, "Oak Trapdoor", "Trapdoor"), + OAK_WOOD(17, 0, 23286, "Oak Wood", ""), + OBSERVER(218, 0, 10726, "Observer", "OBSERVER"), + OBSIDIAN(49, 0, 32723, "Obsidian", "OBSIDIAN"), + ORANGE_BANNER(425, 14, 4839, "Orange Banner", ""), + ORANGE_CARPET(171, 1, 24752, "Orange Carpet", ""), + ORANGE_CONCRETE(251, 1, 19914, "Orange Concrete", ""), + ORANGE_CONCRETE_POWDER(252, 1, 30159, "Orange Concrete Powder", ""), + ORANGE_GLAZED_TERRACOTTA(236, 0, 27451, "Orange Glazed Terracotta", "ORANGE_GLAZED_TERRACOTTA"), + ORANGE_SHULKER_BOX(220, 0, 21673, "Orange Shulker Box", "ORANGE_SHULKER_BOX"), + ORANGE_STAINED_GLASS(95, 1, 25142, "Orange Stained Glass", ""), + ORANGE_STAINED_GLASS_PANE(160, 1, 21089, "Orange Stained Glass Pane", ""), + ORANGE_TERRACOTTA(159, 1, 18684, "Orange Terracotta", ""), + ORANGE_TULIP(38, 5, 26038, "Orange Tulip", ""), + ORANGE_WALL_BANNER(425, -1, 9936, "Orange Banner", ""), + ORANGE_WOOL(35, 1, 23957, "Orange Wool", ""), + OXEYE_DAISY(38, 8, 11709, "Oxeye Daisy", ""), + PACKED_ICE(174, 0, 28993, "Packed Ice", "PACKED_ICE"), + PEONY(175, 5, 21155, "Peony", ""), + PETRIFIED_OAK_SLAB(-1, -1, 18658, "Petrified Oak Slab", ""), + PHANTOM_MEMBRANE(-1, -1, 18398, "Phantom Membrane", ""), + PHANTOM_SPAWN_EGG(-1, -1, 24648, "Phantom Spawn Egg", ""), + PINK_BANNER(425, 9, 19439, "Pink Banner", ""), + PINK_CARPET(171, 6, 30186, "Pink Carpet", ""), + PINK_CONCRETE(251, 6, 5227, "Pink Concrete", ""), + PINK_CONCRETE_POWDER(252, 6, 6421, "Pink Concrete Powder", ""), + PINK_GLAZED_TERRACOTTA(241, 0, 10260, "Pink Glazed Terracotta", "PINK_GLAZED_TERRACOTTA"), + PINK_SHULKER_BOX(225, 0, 24968, "Pink Shulker Box", "PINK_SHULKER_BOX"), + PINK_STAINED_GLASS(95, 6, 16164, "Pink Stained Glass", ""), + PINK_STAINED_GLASS_PANE(160, 6, 24637, "Pink Stained Glass Pane", ""), + PINK_TERRACOTTA(159, 6, 23727, "Pink Terracotta", ""), + PINK_TULIP(38, 7, 27319, "Pink Tulip", ""), + PINK_WALL_BANNER(425, -1, 9421, "Pink Banner", ""), + PINK_WOOL(35, 6, 7611, "Pink Wool", ""), + PISTON(33, 0, 21130, "Piston", "PISTON_BASE"), + PISTON_HEAD(34, 0, 30226, "Piston Head", "PISTON_EXTENSION"), + PLAYER_WALL_HEAD(-1, -1, 13164, "Player Wall Head", ""), + POPPY(38, 0, 12851, "Poppy", ""), + POTATOES(142, 0, 10879, "Potatoes", "POTATO"), + POTTED_ACACIA_SAPLING(-1, -1, 14096, "Potted Acacia Sapling", ""), + POTTED_ALLIUM(-1, -1, 13184, "Potted Allium", ""), + POTTED_AZURE_BLUET(-1, -1, 8754, "Potted Azure Bluet", ""), + POTTED_BIRCH_SAPLING(-1, -1, 32484, "Potted Birch Sapling", ""), + POTTED_BLUE_ORCHID(-1, -1, 6599, "Potted Blue Orchid", ""), + POTTED_BROWN_MUSHROOM(-1, -1, 14481, "Potted Brown Mushroom", ""), + POTTED_CACTUS(-1, -1, 8777, "Potted Cactus", ""), + POTTED_DANDELION(-1, -1, 9727, "Potted Dandelion", ""), + POTTED_DARK_OAK_SAPLING(-1, -1, 6486, "Potted Dark Oak Sapling", ""), + POTTED_DEAD_BUSH(-1, -1, 13020, "Potted Dead Bush", ""), + POTTED_FERN(-1, -1, 23315, "Potted Fern", ""), + POTTED_JUNGLE_SAPLING(-1, -1, 7525, "Potted Jungle Sapling", ""), + POTTED_OAK_SAPLING(-1, -1, 11905, "Potted Oak Sapling", ""), + POTTED_ORANGE_TULIP(-1, -1, 28807, "Potted Orange Tulip", ""), + POTTED_OXEYE_DAISY(-1, -1, 19707, "Potted Oxeye Daisy", ""), + POTTED_PINK_TULIP(-1, -1, 10089, "Potted Pink Tulip", ""), + POTTED_POPPY(-1, -1, 7457, "Potted Poppy", ""), + POTTED_RED_MUSHROOM(-1, -1, 22881, "Potted Red Mushroom", ""), + POTTED_RED_TULIP(-1, -1, 28594, "Potted Red Tulip", ""), + POTTED_SPRUCE_SAPLING(-1, -1, 29498, "Potted Spruce Sapling", ""), + POTTED_WHITE_TULIP(-1, -1, 24330, "Potted White Tulip", ""), + POWERED_RAIL(27, 0, 11064, "Powered Rail", "POWERED_RAIL"), + PRISMARINE(168, 0, 7539, "Prismarine", ""), + PRISMARINE_BRICKS(168, 1, 29118, "Prismarine Bricks", ""), + PRISMARINE_BRICK_SLAB(-1, -1, 26672, "Prismarine Brick Slab", ""), + PRISMARINE_BRICK_STAIRS(-1, -1, 15445, "Prismarine Brick Stairs", ""), + PRISMARINE_SLAB(-1, -1, 31323, "Prismarine Slab", ""), + PRISMARINE_STAIRS(-1, -1, 19217, "Prismarine Stairs", ""), + PUFFERFISH_BUCKET(-1, -1, 8861, "Bucket of Pufferfish", ""), + PUFFERFISH_SPAWN_EGG(-1, -1, 24573, "Pufferfish Spawn Egg", ""), + PUMPKIN(86, 0, 19170, "Pumpkin", "PUMPKIN"), + PUMPKIN_STEM(104, 0, 19021, "Pumpkin Stem", "PUMPKIN_STEM"), + PURPLE_BANNER(425, 5, 29027, "Purple Banner", ""), + PURPLE_CARPET(171, 10, 5574, "Purple Carpet", ""), + PURPLE_CONCRETE(251, 10, 20623, "Purple Concrete", ""), + PURPLE_CONCRETE_POWDER(252, 10, 26808, "Purple Concrete Powder", ""), + PURPLE_GLAZED_TERRACOTTA(245, 0, 4818, "Purple Glazed Terracotta", ""), + PURPLE_SHULKER_BOX(229, 0, 10373, "Purple Shulker Box", "PURPLE_SHULKER_BOX"), + PURPLE_STAINED_GLASS(95, 10, 21845, "Purple Stained Glass", ""), + PURPLE_STAINED_GLASS_PANE(160, 10, 10948, "Purple Stained Glass Pane", ""), + PURPLE_TERRACOTTA(159, 10, 10387, "Purple Terracotta", ""), + PURPLE_WALL_BANNER(425, -1, 14298, "Purple Banner", ""), + PURPLE_WOOL(35, 10, 11922, "Purple Wool", ""), + PURPUR_BLOCK(201, 0, 7538, "Purpur Block", "PURPUR_BLOCK"), + PURPUR_PILLAR(202, 0, 26718, "Purpur Pillar", "PURPUR_PILLAR"), + PURPUR_SLAB(205, 0, 11487, "Purpur Slab", "PURPUR_SLAB"), + PURPUR_STAIRS(203, 0, 8921, "Purpur Stairs", "PURPUR_STAIRS"), + QUARTZ_BLOCK(155, 0, 11987, "Block of Quartz", ""), + QUARTZ_PILLAR(155, 2, 16452, "Quartz Pillar", ""), + QUARTZ_SLAB(44, 7, 4423, "Quartz Slab", ""), + QUARTZ_STAIRS(156, 0, 24079, "Quartz Stairs", "QUARTZ_STAIRS"), + RAIL(66, 0, 13285, "Rail", "RAILS"), + REDSTONE_BLOCK(152, 0, 19496, "Block of Redstone", "REDSTONE_BLOCK"), + REDSTONE_LAMP(123, 0, 8217, "Redstone Lamp", "REDSTONE_LAMP_OFF"), + REDSTONE_ORE(73, 0, 10887, "Redstone Ore", "REDSTONE_ORE"), + REDSTONE_TORCH(76, 0, 22547, "Redstone Torch(on)", "REDSTONE_TORCH_ON"), + UNLIT_REDSTONE_TORCH(75, 0, 22547, "Redstone Torch(off)", "REDSTONE_TORCH_ON"), + REDSTONE_WALL_TORCH(76, -1, 7595, "Redstone Wall Torch", ""), + REDSTONE_WIRE(55, 0, 25984, "Redstone Dust", "REDSTONE_WIRE"), + RED_BANNER(425, 1, 26961, "Red Banner", ""), + RED_CARPET(171, 14, 5424, "Red Carpet", ""), + RED_CONCRETE(251, 14, 8032, "Red Concrete", ""), + RED_CONCRETE_POWDER(252, 14, 13286, "Red Concrete Powder", ""), + RED_GLAZED_TERRACOTTA(249, 0, 24989, "Red Glazed Terracotta", "RED_GLAZED_TERRACOTTA"), + RED_MUSHROOM(40, 0, 19728, "Red Mushroom", "RED_MUSHROOM"), + RED_MUSHROOM_BLOCK(100, 0, 20766, "Red Mushroom Block", "HUGE_MUSHROOM_2"), + RED_NETHER_BRICKS(215, 0, 18056, "Red Nether Bricks", "RED_NETHER_BRICK"), + RED_SAND(12, 1, 16279, "Red Sand", "SAND"), + RED_SANDSTONE(179, 0, 9092, "Red Sandstone", ""), + RED_SANDSTONE_SLAB(182, 0, 17550, "Red Sandstone Slab", "STONE_SLAB2"), + RED_SANDSTONE_STAIRS(180, 0, 25466, "Red Sandstone Stairs", "RED_SANDSTONE_STAIRS"), + RED_SHULKER_BOX(233, 0, 32448, "Red Shulker Box", "RED_SHULKER_BOX"), + RED_STAINED_GLASS(95, 14, 9717, "Red Stained Glass", ""), + RED_STAINED_GLASS_PANE(160, 14, 8630, "Red Stained Glass Pane", ""), + RED_TERRACOTTA(159, 14, 5086, "Red Terracotta", ""), + RED_TULIP(38, 4, 16781, "Red Tulip", ""), + RED_WALL_BANNER(425, -1, 4378, "Red Banner", ""), + RED_WOOL(35, 14, 11621, "Red Wool", ""), + REPEATING_COMMAND_BLOCK(-1, -1, 12405, "Repeating Command Block", ""), + ROSE_BUSH(175, 4, 6080, "Rose Bush", ""), + SALMON_BUCKET(-1, -1, 31427, "Bucket of Salmon", ""), + SALMON_SPAWN_EGG(-1, -1, 18739, "Salmon Spawn Egg", ""), + SAND(12, 0, 11542, "Sand", ""), + SANDSTONE(24, 0, 13141, "Sandstone", ""), + SANDSTONE_SLAB(44, 1, 29830, "Sandstone Slab", ""), + SCUTE(-1, -1, 11914, "Scute", ""), + SEAGRASS(-1, -1, 23942, "Seagrass", ""), + SEA_LANTERN(169, 0, 16984, "Sea Lantern", "SEA_LANTERN"), + SEA_PICKLE(-1, -1, 19562, "Sea Pickle", ""), + SHULKER_BOX(229, 0, 7776, "Shulker Box", ""), + SHULKER_SHELL(450, 0, 27848, "Shulker Shell", "SHULKER_SHELL"), + SKELETON_WALL_SKULL(397, -1, 31650, "Skeleton Wall Skull", ""), + SLIME_BLOCK(165, 0, 31892, "Slime Block", "SLIME_BLOCK"), + SMOOTH_QUARTZ(-1, -1, 14415, "Smooth Quartz", ""), + SMOOTH_RED_SANDSTONE(179, 2, 25180, "Smooth Red Sandstone", ""), + SMOOTH_SANDSTONE(24, 2, 30039, "Smooth Sandstone", ""), + SMOOTH_STONE(-1, -1, 21910, "Smooth Stone", ""), + SNOW(78, 0, 14146, "Snow", "SNOW"), + SNOW_BLOCK(80, 0, 19913, "Snow Block", "SNOW_BLOCK"), + SOUL_SAND(88, 0, 16841, "Soul Sand", "SOUL_SAND"), + SPAWNER(52, 90, 25500, "Spawner", "MOB_SPAWNER"), + SPLASH_POTION(438, 0, 30248, "Splash Potion", "SPLASH_POTION"), + SPONGE(19, 0, 15860, "Sponge", "SPONGE"), + SPRUCE_BOAT(444, 0, 9606, "Spruce Boat", "BOAT_SPRUCE"), + SPRUCE_BUTTON(-1, -1, 23281, "Spruce Button", ""), + SPRUCE_DOOR(193, 0, 10642, "Spruce Door", "SPRUCE_DOOR"), + SPRUCE_FENCE(188, 0, 25416, "Spruce Fence", "SPRUCE_FENCE"), + SPRUCE_FENCE_GATE(183, 0, 26423, "Spruce Fence Gate", "SPRUCE_FENCE_GATE"), + SPRUCE_LEAVES(18, 1, 20039, "Spruce Leaves", ""), + SPRUCE_LOG(17, 1, 9726, "Spruce Log", ""), + SPRUCE_PRESSURE_PLATE(-1, -1, 15932, "Spruce Pressure Plate", ""), + SPRUCE_SLAB(126, 1, 4348, "Spruce Slab", ""), + SPRUCE_TRAPDOOR(-1, -1, 10289, "Spruce Trapdoor", ""), + SPRUCE_WOOD(17, 1, 22538, "Spruce Wood", ""), + STICK(280, 0, 9773, "Stick", "STICK"), + STICKY_PISTON(29, 0, 18127, "Sticky Piston", "PISTON_STICKY_BASE"), + STONE_AXE(275, 0, 6338, "Stone Axe", "STONE_AXE"), + STONE_BRICKS(98, 0, 6962, "Stone Bricks", ""), + STONE_BRICK_SLAB(44, 5, 19676, "Stone Brick Slab", ""), + STONE_BRICK_STAIRS(109, 0, 27032, "Stone Brick Stairs", "SMOOTH_STAIRS"), + STONE_BUTTON(77, 0, 12279, "Stone Button", "STONE_BUTTON"), + STONE_HOE(291, 0, 22855, "Stone Hoe", "STONE_HOE"), + STONE_PICKAXE(274, 0, 14611, "Stone Pickaxe", "STONE_PICKAXE"), + STONE_PRESSURE_PLATE(70, 0, 22591, "Stone Pressure Plate", "STONE_PLATE"), + STONE_SHOVEL(273, 0, 9520, "Stone Shovel", "STONE_SPADE"), + STONE_SLAB(44, 0, 19838, "Stone Slab", ""), + STONE_SWORD(272, 0, 25084, "Stone Sword", "STONE_SWORD"), + STRING(287, 0, 12806, "String", "STRING"), + STRIPPED_ACACIA_LOG(-1, -1, 18167, "Stripped Acacia Log", ""), + STRIPPED_ACACIA_WOOD(-1, -1, 17579, "Stripped Acacia Wood", ""), + STRIPPED_BIRCH_LOG(-1, -1, 8838, "Stripped Birch Log", ""), + STRIPPED_BIRCH_WOOD(-1, -1, 30740, "Stripped Birch Wood", ""), + STRIPPED_DARK_OAK_LOG(-1, -1, 6492, "Stripped Dark Oak Log", ""), + STRIPPED_DARK_OAK_WOOD(-1, -1, 6606, "Stripped Dark Oak Wood", ""), + STRIPPED_JUNGLE_LOG(-1, -1, 15476, "Stripped Jungle Log", ""), + STRIPPED_JUNGLE_WOOD(-1, -1, 5072, "Stripped Jungle Wood", ""), + STRIPPED_OAK_LOG(-1, -1, 20523, "Stripped Oak Log", ""), + STRIPPED_OAK_WOOD(-1, -1, 4514, "Stripped Oak Wood", ""), + STRIPPED_SPRUCE_LOG(-1, -1, 6140, "Stripped Spruce Log", ""), + STRIPPED_SPRUCE_WOOD(-1, -1, 15634, "Stripped Spruce Wood", ""), + STRUCTURE_BLOCK(255, -1, 26831, "Structure Block", ""), + STRUCTURE_VOID(217, -1, 30806, "Structure Void", ""), + SUNFLOWER(175, 0, 7408, "Sunflower", ""), + TALL_GRASS(31, 0, 21559, "Tall Grass", ""), + TALL_SEAGRASS(-1, -1, 27189, "Tall Seagrass", ""), + TERRACOTTA(172, 0, 16544, "Terracotta", "HARD_CLAY"), + TNT(46, 0, 7896, "TNT", "TNT"), + TORCH(50, 0, 6063, "Torch", "TORCH"), + TRAPPED_CHEST(146, 0, 18970, "Trapped Chest", "TRAPPED_CHEST"), + TRIDENT(-1, -1, 7534, "Trident", ""), + TROPICAL_FISH(-1, -1, 12795, "Tropical Fish", ""), + TROPICAL_FISH_BUCKET(-1, -1, 30390, "Bucket of Tropical Fish", ""), + TROPICAL_FISH_SPAWN_EGG(-1, -1, 19713, "Tropical Fish Spawn Egg", ""), + TUBE_CORAL(-1, -1, 23048, "Tube Coral", ""), + TUBE_CORAL_BLOCK(-1, -1, 23723, "Tube Coral Block", ""), + TUBE_CORAL_FAN(-1, -1, 19929, "Tube Coral Fan", ""), + TURTLE_EGG(-1, -1, 32101, "Turtle Egg", ""), + TURTLE_HELMET(-1, -1, 30120, "Turtle Shell", ""), + TURTLE_SPAWN_EGG(-1, -1, 17324, "Turtle Spawn Egg", ""), + VINE(106, 0, 14564, "Vines", "VINE"), + VOID_AIR(0, 0, 13668, "Air", ""), + WALL_SIGN(68, 0, 10644, "Wall Sign", "WALL_SIGN"), + WALL_TORCH(50, -1, 25890, "Wall Torch", ""), + FLOWING_WATER(8, 0, 24998, "Flowing Water", "FLOWING_WATER"), + WATER(9, 0, 24998, "Water", "STATIONARY_WATER"), + WET_SPONGE(19, 1, 9043, "Wet Sponge", ""), + WHEAT(296, 0, 27709, "Wheat", "CROPS"), + WHEAT_SEEDS(295, 0, 28742, "Wheat Seeds", "SEEDS"), + WHITE_BANNER(425, 15, 17562, "White Banner", ""), + WHITE_CARPET(171, 0, 15117, "White Carpet", ""), + WHITE_CONCRETE(251, 0, 6281, "White Concrete", ""), + WHITE_CONCRETE_POWDER(252, 0, 10363, "White Concrete Powder", ""), + WHITE_GLAZED_TERRACOTTA(235, 0, 11326, "White Glazed Terracotta", "WHITE_GLAZED_TERRACOTTA"), + WHITE_SHULKER_BOX(219, 0, 31750, "White Shulker Box", "WHITE_SHULKER_BOX"), + WHITE_STAINED_GLASS(95, 0, 31190, "White Stained Glass", ""), + WHITE_STAINED_GLASS_PANE(160, 0, 10557, "White Stained Glass Pane", ""), + WHITE_TERRACOTTA(159, 0, 20975, "White Terracotta", ""), + WHITE_TULIP(38, 6, 9742, "White Tulip", ""), + WHITE_WALL_BANNER(425, -1, 15967, "White Banner", ""), + WHITE_WOOL(35, 0, 8624, "White Wool", "Wool"), + WITHER_SKELETON_WALL_SKULL(397, -1, 9326, "Wither Skeleton Wall Skull", ""), + WOODEN_AXE(271, 0, 6292, "Wooden Axe", "WOOD_AXE"), + WOODEN_HOE(290, 0, 16043, "Wooden Hoe", "WOOD_HOE"), + WOODEN_PICKAXE(270, 0, 12792, "Wooden Pickaxe", "WOOD_PICKAXE"), + WOODEN_SHOVEL(269, 0, 28432, "Wooden Shovel", "WOOD_SPADE"), + WOODEN_SWORD(268, 0, 7175, "Wooden Sword", "WOOD_SWORD"), + YELLOW_BANNER(425, 11, 30382, "Yellow Banner", ""), + YELLOW_CARPET(171, 4, 18149, "Yellow Carpet", ""), + YELLOW_CONCRETE(251, 4, 15722, "Yellow Concrete", ""), + YELLOW_CONCRETE_POWDER(252, 4, 10655, "Yellow Concrete Powder", ""), + YELLOW_GLAZED_TERRACOTTA(239, 0, 10914, "Yellow Glazed Terracotta", "YELLOW_GLAZED_TERRACOTTA"), + YELLOW_SHULKER_BOX(223, 0, 28700, "Yellow Shulker Box", "YELLOW_SHULKER_BOX"), + YELLOW_STAINED_GLASS(95, 4, 12182, "Yellow Stained Glass", ""), + YELLOW_STAINED_GLASS_PANE(160, 4, 20298, "Yellow Stained Glass Pane", ""), + YELLOW_TERRACOTTA(159, 4, 32129, "Yellow Terracotta", ""), + YELLOW_WALL_BANNER(425, -1, 32004, "Yellow Banner", ""), + YELLOW_WOOL(35, 4, 29507, "Yellow Wool", ""), + ZOMBIE_WALL_HEAD(397, -1, 16296, "Zombie Wall Head", ""), + + BRAIN_CORAL_WALL_FAN(-1, -1, 22685, "Brain Coral Wall Fan"), + BUBBLE_CORAL_WALL_FAN(-1, -1, 20382, "Bubble Coral Wall Fan"), + DEAD_BRAIN_CORAL_FAN(-1, -1, 26150, "Dead Brain Coral Fan"), + DEAD_BRAIN_CORAL_WALL_FAN(-1, -1, 23718, "Dead Brain Coral Wall Fan"), + DEAD_BUBBLE_CORAL_FAN(-1, -1, 17322, "Dead Bubble Coral Fan"), + DEAD_BUBBLE_CORAL_WALL_FAN(-1, -1, 18453, "Dead Bubble Coral Wall Fan"), + DEAD_FIRE_CORAL_FAN(-1, -1, 27073, "Dead Fire Coral Fan"), + DEAD_FIRE_CORAL_WALL_FAN(-1, -1, 23375, "Dead Fire Coral Wall Fan"), + DEAD_HORN_CORAL_FAN(-1, -1, 11387, "Dead Horn Coral Fan"), + DEAD_HORN_CORAL_WALL_FAN(-1, -1, 27550, "Dead Horn Coral Wall Fan"), + DEAD_TUBE_CORAL_FAN(-1, -1, 17628, "Dead Tube Coral Fan"), + DEAD_TUBE_CORAL_WALL_FAN(-1, -1, 5128, "Dead Tube Coral Wall Fan"), + FIRE_CORAL_WALL_FAN(-1, -1, 20100, "Fire Coral Wall Fan"), + HORN_CORAL_WALL_FAN(-1, -1, 28883, "Horn Coral Wall Fan"), + TUBE_CORAL_WALL_FAN(-1, -1, 25282, "Tube Coral Wall Fan"); + + private int legacyId; + private int legacyData; + private int id; + private String name; + private String legacyName; + private String bukkitName; + private String mojangName; + Material mat; + + CMIMaterial(int legacyId, int legacyData, int id, String name) { + this(legacyId, legacyData, id, name, null); + } + + CMIMaterial(int legacyId, int legacyData, int id, String name, String legacyName) { + this.legacyId = legacyId; + this.legacyData = legacyData; + this.id = id; + this.name = name; + this.legacyName = legacyName; + } + + public String getName() { + return name; + } + + public int getLegacyId() { + return this.legacyId; + } + + public int getId() { + if (version.isEqualOrHigher(Version.v1_13_R1)) { + return this.id; + } + return getLegacyId(); + } + + public Material getMaterial() { + return mat == null ? null : mat; + } + + public void updateMaterial() { + if (mat == null) { + for (Material one : Material.class.getEnumConstants()) { + if (one.getId() != this.getId()) + continue; + mat = one; + break; + } + } + if (mat == null) { + for (Material one : Material.class.getEnumConstants()) { + if (!one.name().equalsIgnoreCase(this.name())) + continue; + mat = one; + break; + } + } + if (mat == null) { + for (Material one : Material.class.getEnumConstants()) { + if (!one.name().replace("_", "").equalsIgnoreCase(this.getName().replace(" ", ""))) + continue; + mat = one; + break; + } + } + if (mat == null) { + for (Material one : Material.class.getEnumConstants()) { + if (!one.name().replace("_", "").equalsIgnoreCase(this.getLegacyName().replace(" ", "").replace("_", ""))) + continue; + mat = one; + break; + } + } + } + + public ItemStack newItemStack() { + if (mat == null) { + for (Material one : Material.class.getEnumConstants()) { + if (one.getId() != this.getId()) + continue; + mat = one; + break; + } + } + if (version.isEqualOrHigher(Version.v1_13_R1)) { + return new ItemStack(mat == null ? Material.STONE : mat); + } + return new ItemStack(mat == null ? Material.STONE : mat, 1, (short) this.getLegacyData()); + } + + @Deprecated + public short getData() { + if (version.isEqualOrHigher(Version.v1_13_R1)) { + return 0; + } + return (short) legacyData; + } + + public int getLegacyData() { + return legacyData; + } + + public static CMIMaterial getRandom(CMIMaterial mat) { + + List ls = new ArrayList(); + + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getLegacyId() == -1) + continue; + if (one.getLegacyId() != mat.getLegacyId()) + continue; + ls.add(one); + } + + if (ls.isEmpty() || ls.size() == 1) { + String part = mat.name; + if (part.contains("_")) + part = part.split("_")[part.split("[_]").length - 1]; + for (CMIMaterial one : CMIMaterial.values()) { + if (!one.name().endsWith(part)) + continue; + ls.add(one); + } + } + + Collections.shuffle(ls); + + return ls.isEmpty() ? CMIMaterial.NONE : ls.get(0); + } + + public static CMIMaterial get(String id) { + Integer ids = null; + Integer data = null; + try { + ids = Integer.parseInt(id); + } catch (Exception e) { + if (id.contains(":")) { + try { + ids = Integer.parseInt(id.split(":")[0]); + data = Integer.parseInt(id.split(":")[1]); + id = id.split(":")[0]; + } catch (Exception ex) { + } + } + } + + CMIMaterial mat = null; + + CMIItemStack ci = byBukkitName.get(id); + if (ci != null) + mat = ci.getCMIType(); + if (mat != null) + return mat; + + ci = byMojangName.get(id); + if (ci != null) + mat = ci.getCMIType(); + + if (mat != null) + return mat; + + if (ids != null) { + if (data == null) + mat = get(ids); + else + mat = get(ids, data); + } + + if (mat != null) + return mat; + for (CMIMaterial one : CMIMaterial.values()) { + if (ids != null && data == null && one.getId() == ids) + return one; + if (ids != null && data != null && one.getId() == ids && one.getLegacyData() == data) + return one; + } + + id = id.replace("_", "").toLowerCase(); + for (CMIMaterial one : CMIMaterial.values()) { + if (one.name().replace("_", "").equalsIgnoreCase(id)) + return one; + if (one.getName().replace("_", "").replace(" ", "").equalsIgnoreCase(id)) + return one; + } + return CMIMaterial.NONE; + } + + public static CMIMaterial get(Material mat) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getMaterial() == null) + continue; + if (one.getMaterial().getId() == mat.getId()) { + return one; + } + } + return CMIMaterial.NONE; + } + + public static CMIMaterial get(int id) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getMaterial() == null) + continue; + if (one.getMaterial().getId() == id) { + return one; + } + } + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getLegacyId() == id) { + return one; + } + } + return CMIMaterial.NONE; + } + + public static CMIMaterial get(ItemStack item) { +// if (CMIMaterial.isMonsterEgg(item.getType())) { +// int tid = CMI.getInstance().getNMS().getEggId(item); +// return get(item.getType().getId(), tid); +// } + CMIMaterial m = get(item.getType().getId(), item.getData().getData()); + + if (m == null) { + CMIItemStack cm = byBukkitName.get(item.getType().toString()); + if (cm != null) + m = cm.getCMIType(); + } + + return m == null ? CMIMaterial.NONE : m; + } + + public static CMIMaterial get(Block block) { + CMIMaterial m = get(block.getType().getId(), block.getData()); + if (m == null) { + CMIItemStack cm = byBukkitName.get(block.getType().toString().replace("_", "").toLowerCase()); + if (cm != null) + m = cm.getCMIType(); + } + if (m == null) { + CMIItemStack cm = byBukkitName.get(block.getType().name().toString().replace("_", "").toLowerCase()); + if (cm != null) + m = cm.getCMIType(); + } + return m == null ? CMIMaterial.NONE : m; + } + + public static CMIMaterial get(int id, int data) { + CMIMaterial mat = null; + + CMIItemStack cm = byBukkitName.get(id + ":" + data); + if (cm != null) + mat = cm.getCMIType(); + + cm = byId.get(id); + if (cm != null) + mat = cm.getCMIType(); + + if (mat == null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getId() == id) { + mat = one; + break; + } + } + } + if (mat != null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getId() == mat.getId()) { + if (one.getLegacyData() == data) { + mat = one; + break; + } + } + } + } + return mat == null ? CMIMaterial.NONE : mat; + } + + public static CMIMaterial getLegacy(int id) { + CMIItemStack cm = byId.get(id); + if (cm != null) + return cm.getCMIType(); + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getLegacyId() == id) { + return one; + } + } + return CMIMaterial.NONE; + } + + public short getMaxDurability() { + return this.getMaterial() == null ? 0 : this.getMaterial().getMaxDurability(); + } + + public boolean isBlock() { + return this.getMaterial() == null ? false : this.getMaterial().isBlock(); + } + + public boolean isSolid() { + return this.getMaterial() == null ? false : this.getMaterial().isSolid(); + } + + public static boolean isMonsterEgg(Material mat) { + if (mat == null) + return false; + if (mat.toString().contains("_EGG")) + return true; + return false; + } + + public boolean isMonsterEgg() { + if (toString().contains("_EGG")) + return true; + return false; + } + + public static boolean isAir(Material mat) { + if (mat == null) + return false; + switch (mat.getId()) { + case 0: + case 17422: + case 9648: + case 13668: + return true; + } + return false; + } + + public boolean isAir() { + switch (this) { + case AIR: + case CAVE_AIR: + case VOID_AIR: + return true; + } + return false; + } + + public boolean isShulkerBox() { + if (toString().contains("SHULKER_BOX")) + return true; + return false; + } + + public static boolean isBed(Material mat) { + if (mat == null) + return false; + if (mat.toString().contains("_BED")) + return true; + return false; + } + + public boolean equals(Material mat) { + if (getMaterial() == null) + return false; + return this.getMaterial().equals(mat); + } + + public String getLegacyName() { + return legacyName == null ? "" : legacyName; + } + + public void setLegacyName(String legacyName) { + this.legacyName = legacyName; + } + + public String getBukkitName() { + if (bukkitName == null) + bukkitName = getMaterial().name(); + return bukkitName; + } + + public void setBukkitName(String bukkitName) { + this.bukkitName = bukkitName; + } + + public String getMojangName() { + if (mojangName == null) + mojangName = ItemReflection.getItemMinecraftName(this.newItemStack()); + return mojangName; + } + + public void setMojangName(String mojangName) { + this.mojangName = mojangName; + } + } +} diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java new file mode 100644 index 00000000..b1f22f97 --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java @@ -0,0 +1,162 @@ +/** + * Copyright (C) 2017 Zrips + */ + +package com.gamingmesh.jobs.CMILib; + +import java.lang.reflect.Method; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; + +public class ItemReflection { + + private static Class CraftServerClass; + private static Object CraftServer; + private static Class CraftItemStack; + private static Class Item; + private static Class IStack; + + static { + initialize(); + } + +// public ItemReflection() { +// initialize(); +// } + + private static void initialize() { + try { + CraftServerClass = getBukkitClass("CraftServer"); + } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) { + e.printStackTrace(); + } + try { + CraftServer = CraftServerClass.cast(Bukkit.getServer()); + } catch (SecurityException | IllegalArgumentException e) { + e.printStackTrace(); + } + try { + CraftItemStack = getBukkitClass("inventory.CraftItemStack"); + } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) { + e.printStackTrace(); + } + try { + Item = getMinecraftClass("Item"); + } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) { + e.printStackTrace(); + } + try { + IStack = getMinecraftClass("ItemStack"); + } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) { + e.printStackTrace(); + } + } + + private static Class getBukkitClass(String nmsClassString) throws ClassNotFoundException { + return Class.forName("org.bukkit.craftbukkit." + Jobs.getVersionCheckManager().getVersion() + "." + nmsClassString); + } + + public static Class getMinecraftClass(String nmsClassString) throws ClassNotFoundException { + return Class.forName("net.minecraft.server." + Jobs.getVersionCheckManager().getVersion() + "." + nmsClassString); + } + + public static String getItemMinecraftName(ItemStack item) { + try { + Object nmsStack = asNMSCopy(item); + Method itemMeth = Item.getMethod("getById", int.class); + Object res = itemMeth.invoke(Item, item.getType().getId()); + + String ff = "b"; + switch (Jobs.getVersionCheckManager().getVersion()) { + case v1_10_R1: + case v1_9_R1: + case v1_9_R2: + case v1_8_R1: + case v1_8_R3: + case v1_8_R2: + ff = "a"; + break; + case v1_11_R1: + case v1_11_R2: + case v1_12_R1: + case v1_12_R2: + ff = "b"; + break; + case v1_13_R2: + case v1_13_R1: + case v1_14_R2: + case v1_14_R1: + case v1_15_R2: + case v1_15_R1: + ff = "h"; + break; + case v1_7_R1: + case v1_7_R2: + case v1_7_R3: + case v1_7_R4: + ff = "n"; + break; + default: + break; + } + + Method meth2 = res.getClass().getMethod(ff, IStack); + Object name = meth2.invoke(res, nmsStack); + return name.toString(); + } catch (Exception e) { + return item != null ? item.getType().name() : ""; + } + } + + public String getItemMinecraftNamePath(ItemStack item) { + try { + Object nmsStack = asNMSCopy(item); + Method itemMeth = Item.getMethod("getById", int.class); + Object res = itemMeth.invoke(Item, item.getType().getId()); + Method nameThingy = Item.getMethod("j", IStack); + Object resThingy = nameThingy.invoke(res, nmsStack); + return resThingy.toString(); + } catch (Exception e) { + return null; + } + } + + public static Object asNMSCopy(ItemStack item) { + try { + Method meth = CraftItemStack.getMethod("asNMSCopy", ItemStack.class); + return meth.invoke(CraftItemStack, item); + } catch (Exception e) { + return null; + } + } + + public Object asBukkitCopy(Object item) { + try { + Method meth = CraftItemStack.getMethod("asBukkitCopy", IStack); + return meth.invoke(CraftItemStack, item); + } catch (Exception e) { + return null; + } + } + + public Object getCraftServer() { + return CraftServer; + } + + public ItemStack getItemInOffHand(Player player) { + if (Jobs.getVersionCheckManager().getVersion().isLower(Version.v1_9_R1)) + return null; + return player.getInventory().getItemInOffHand(); + } + + public void setEndermiteActive(Entity ent, boolean state) { + + } + +} diff --git a/src/main/java/com/gamingmesh/jobs/CmiItems/CMIItem.java b/src/main/java/com/gamingmesh/jobs/CmiItems/CMIItem.java deleted file mode 100644 index 69eacfad..00000000 --- a/src/main/java/com/gamingmesh/jobs/CmiItems/CMIItem.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.gamingmesh.jobs.CmiItems; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.stuff.Util; - -public class CMIItem { - - private int id = 0; - private short data = 0; - private int amount = 0; - - private String bukkitName = null; - private Material material = null; - private ItemStack item; - - public CMIItem(Material material) { - this.material = material; - } - - @Override - public CMIItem clone() { - CMIItem cm = new CMIItem(material); - cm.setId(id); - cm.setData(data); - cm.setBukkitName(bukkitName); - cm.setItemStack(this.item); - return cm; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public short getData() { - return data; - } - - public boolean isTool() { - return getMaxDurability() > 0; - } - - public short getDurability() { - return this.getItemStack().getDurability(); - } - - public short getMaxDurability() { - return this.material.getMaxDurability(); - } - - public void setData(short data) { - this.data = data; - } - - public CMIItem setDisplayName(String name) { - if (name == null) - return this; - ItemMeta meta = this.getItemStack().getItemMeta(); - meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); - this.getItemStack().setItemMeta(meta); - return this; - } - - public String getDisplayName() { - ItemMeta meta = this.getItemStack().getItemMeta(); - return meta.getDisplayName() == null ? this.getRealName() : meta.getDisplayName(); - } - - public CMIItem addLore(String string) { - if (string == null) - return this; - ItemMeta meta = this.getItemStack().getItemMeta(); - List lore = meta.getLore(); - if (lore == null) - lore = new ArrayList(); - lore.add(ChatColor.translateAlternateColorCodes('&', string)); - meta.setLore(lore); - this.getItemStack().setItemMeta(meta); - return this; - } - - public CMIItem setLore(List lore) { - if (lore == null) - return this; - ItemMeta meta = this.getItemStack().getItemMeta(); - List t = new ArrayList(); - for (String one : lore) { - t.add(ChatColor.translateAlternateColorCodes('&', one)); - } - meta.setLore(t); - this.getItemStack().setItemMeta(meta); - return this; - } - - public CMIItem addEnchant(Enchantment enchant, Integer level) { - if (enchant == null) - return this; - ItemMeta meta = this.getItemStack().getItemMeta(); - meta.addEnchant(enchant, level, true); - this.getItemStack().setItemMeta(meta); - return this; - } - - public CMIItem addEnchant(HashMap enchants) { - if (enchants == null || enchants.isEmpty()) - return this; - for (Entry oneEnch : enchants.entrySet()) { - this.addEnchant(oneEnch.getKey(), oneEnch.getValue()); - } - return this; - } - - public CMIItem clearEnchants() { - ItemMeta meta = this.getItemStack().getItemMeta(); - meta.getEnchants().clear(); - this.getItemStack().setItemMeta(meta); - return this; - } - - public List getLore() { - ItemMeta meta = this.getItemStack().getItemMeta(); - return meta.getLore(); - } - - public String getRealName() { - return Jobs.getItemManager().getRealName(this, true).getName(); - } - - public String getBukkitName() { - return bukkitName; - } - - public void setBukkitName(String bukkitName) { - this.bukkitName = bukkitName; - } - - public Material getMaterial() { - return material; - } - - public void setMaterial(Material material) { - this.material = material; - } - - public ItemStack getItemStack() { - if (item == null) { - this.item = new ItemStack(material, this.amount == 0 ? 1 : this.amount, data); - } - - if (this.item.getType() == Material.MOB_SPAWNER) { - if (data == 0) - data = 90; - EntityType type = EntityType.fromId(data); - if (type != null) - this.item = Util.setEntityType(this.item, type); - } - - return item; - } - - public CMIItem setItemStack(ItemStack item) { - this.item = item; - if (item != null) { - this.amount = item.getAmount(); - if ((material.isBlock() || material.isSolid())) - data = item.getData().getData(); - if (item.getType().getMaxDurability() - item.getDurability() < 0) - data = item.getDurability(); - if (item.getType() == Material.MOB_SPAWNER) - data = Util.getEntityType(item).getTypeId(); - } - return this; - } - - public int getAmount() { - return amount; - } - - public void setAmount(int amount) { - this.amount = amount; - } - - public boolean isSimilar(ItemStack item) { - return isSimilar(Jobs.getItemManager().getItem(item)); - } - - public boolean isSimilar(CMIItem item) { - if (item == null) - return false; - return this.getMaterial().equals(item.material) && this.getData() == item.getData(); - } - -} diff --git a/src/main/java/com/gamingmesh/jobs/CmiItems/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CmiItems/ItemManager.java deleted file mode 100644 index 728c6878..00000000 --- a/src/main/java/com/gamingmesh/jobs/CmiItems/ItemManager.java +++ /dev/null @@ -1,1123 +0,0 @@ -package com.gamingmesh.jobs.CmiItems; - -import java.util.HashMap; - -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; - -import com.gamingmesh.jobs.Jobs; - -public class ItemManager { - - private Jobs plugin; - - HashMap byId = new HashMap(); - HashMap byBukkitName = new HashMap(); - HashMap byMaterial = new HashMap(); - - public ItemManager(Jobs plugin) { - this.plugin = plugin; - } - - public void load() { - for (Material one : Material.values()) { - if (one == null) - continue; - int id = one.getId(); - String bukkitName = one.name(); - - CMIItem cm = new CMIItem(one); - cm.setId(id); - cm.setBukkitName(bukkitName); - - byId.put(id, cm); - byBukkitName.put(bukkitName.toLowerCase().replace("_", ""), cm); - byMaterial.put(one, cm); - } - - for (CMIMaterial one : CMIMaterial.values()) { - proccessItemName(one); - } - } - - public CMIItem getItem(Material mat) { - CMIItem cm = byMaterial.get(mat); - return cm.clone(); - } - - public CMIItem getItem(ItemStack item) { - return getItem(item.getType()); - } - - public CMIItem getItem(String name) { - if (byBukkitName.isEmpty()) - load(); - CMIItem cm = null; - name = name.toLowerCase().replace("_", "").replace("minecraft:", ""); - - short data = -999; - - if (name.contains(":")) { - name = name.split(":")[0]; - try { - data = Short.parseShort(name.split(":")[1]); - } catch (Exception e) { - } - } - - if (name.contains("-")) { - name = name.split("-")[0]; - try { - data = Short.parseShort(name.split("-")[1]); - } catch (Exception e) { - } - } - - cm = byBukkitName.get(name); - if (cm == null) { - try { - cm = byId.get(Integer.parseInt(name)); - } catch (Exception e) { - } - - if (cm == null) { - for (Material one : Material.values()) { - if (one.name().replace("_", "").equalsIgnoreCase(name)) { - cm = byMaterial.get(one); - break; - } - } - if (cm == null) { - for (CMIMaterial one : CMIMaterial.values()) { - if (one.getName().replace(" ", "").equalsIgnoreCase(name)) { - cm = byId.get(one.getId()); - if (cm != null) { - data = (short) one.getData(); - } - break; - } - } - if (cm == null) { - for (CMIMaterial one : CMIMaterial.values()) { - if (one.getName().replace(" ", "").toLowerCase().startsWith(name)) { - cm = byId.get(one.getId()); - if (cm != null) { - data = (short) one.getData(); - } - break; - } - } - } - if (cm == null) { - for (CMIMaterial one : CMIMaterial.values()) { - - if (one.getName().replace(" ", "").toLowerCase().contains(name)) { - cm = byId.get(one.getId()); - if (cm != null) { - data = (short) one.getData(); - } - break; - } - } - } - } - } - } - - CMIItem ncm = null; - if (cm != null) - ncm = cm.clone(); - - if (ncm != null && data != -999) - ncm.setData(data); - - return ncm; - } - - public Material getMaterial(String name) { - CMIItem cm = getItem(name); - if (cm == null) - return Material.AIR; - return cm.getMaterial(); - } - - public CMIMaterial getRealName(CMIItem item) { - return getRealName(item, false); - } - - public CMIMaterial getRealName(CMIItem item, boolean safe) { - for (CMIMaterial one : CMIMaterial.values()) { - if (one.getId() == item.getId() && one.getData() == item.getData()) - return one; - } - return safe ? CMIMaterial.air_0_0 : null; - } - - private static CMIMaterial proccessItemName(CMIMaterial one) { - if (one.getName().contains("[colorNames]")) - one.setName(one.getName().replace("[colorNames]", CMIChatColor.getById(one.getData()).getName())); - else if (one.getName().contains("[entityNames]")) - one.setName(one.getName().replace("[entityNames]", CMIEntityType.getById(one.getData()).getName())); - return one; - } - - public enum CMIChatColor { - White(0, "White"), - Orange(1, "Orange"), - Magenta(2, "Magenta"), - Light(3, "Light Blue"), - Yellow(4, "Yellow"), - Lime(5, "Lime"), - Pink(6, "Pink"), - Gray(7, "Gray"), - Light_Gray(8, "Light Gray"), - Cyan(9, "Cyan"), - Purple(10, "Purple"), - Blue(11, "Blue"), - Brown(12, "Brown"), - Green(13, "Green"), - Red(14, "Red"), - Black(15, "Black"); - - private int id; - private String name; - - CMIChatColor(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public static String translate(String msg) { - return ChatColor.translateAlternateColorCodes('&', msg); - } - - public String getName() { - return name; - } - - public static CMIChatColor getById(int id) { - for (CMIChatColor one : CMIChatColor.values()) { - if (one.getId() == id) - return one; - } - return CMIChatColor.White; - } - } - - public enum CMIEntityType { - elder_guardian(4, "Elder Guardian"), - wither_skeleton(5, "Wither Skeleton"), - stray(6, "Stray"), - husk(23, "Husk"), - zombie_villager(27, "Zombie Villager"), - skeleton_horse(28, "Skeleton horse"), - zombie_horse(29, "Zombie Horse"), - armor_stand(30, "Armor Stand"), - donkey(31, "Donkey"), - mule(32, "Mule"), - evocation_illager(34, "Evocation Illager"), - vex(35, "Vex"), - vindication_illager(36, "Vindication Illager"), - illusion_illager(37, "Illusion Illager"), - creeper(50, "Creeper"), - skeleton(51, "Skeleton"), - spider(52, "Spider"), - giant(53, "Giant"), - zombie(54, "Zombie"), - slime(55, "Slime"), - ghast(56, "Ghast"), - zombie_pigman(57, "Zombie pigman"), - enderman(58, "Enderman"), - cave_spider(59, "Cave Spider"), - silverfish(60, "SilverFish"), - blaze(61, "Blaze"), - magma_cube(62, "Magma Cube"), - ender_dragon(63, "Ender Dragon"), - wither(64, "Wither"), - bat(65, "Bat"), - witch(66, "Witch"), - endermite(67, "Endermite"), - guardian(68, "Guardian"), - shulker(69, "Shulker"), - pig(90, "Pig"), - sheep(91, "Sheep"), - cow(92, "Cow"), - chicken(93, "Chicken"), - squid(94, "Squid"), - wolf(95, "Wolf"), - mushroom_cow(96, "Mushroom Cow"), - snowman(97, "Snowman"), - ocelot(98, "Ocelot"), - villager_golem(99, "Iron Golem"), - horse(100, "Horse"), - rabbit(101, "Rabbit"), - polar_bear(102, "Polar Bear"), - llama(103, "Llama"), - parrot(105, "Parrot"), - villager(120, "Villager"); - - private int id; - private String name; - - CMIEntityType(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public String getName() { - return name; - } - - public EntityType getType() { - for (EntityType one : EntityType.values()) { - if (one.getTypeId() == this.getId()) - return one; - } - return null; - } - - public static CMIEntityType getById(int id) { - for (CMIEntityType one : CMIEntityType.values()) { - if (one.getId() == id) - return one; - } - return null; - } - - public static CMIEntityType getByName(String name) { - name = name.toLowerCase().replace("_", ""); - CMIEntityType type = null; - for (CMIEntityType one : CMIEntityType.values()) { - if (one.name().equalsIgnoreCase(name) || one.name.replace(" ", "").equalsIgnoreCase(name)) { - type = one; - break; - } - } - if (type == null) - for (CMIEntityType one : CMIEntityType.values()) { - if (one.name.contains(name)) { - type = one; - break; - } - } - return type; - } - } - - public enum CMIMaterial { - air_0_0(0, 0, "Unknown"), - stone_1_0(1, 0, "Stone"), - stone_1_1(1, 1, "Granite"), - stone_1_2(1, 2, "Polished Granite"), - stone_1_3(1, 3, "Diorite"), - stone_1_4(1, 4, "Polished Diorite"), - stone_1_5(1, 5, "Andesite"), - stone_1_6(1, 6, "Polished Andesite"), - grass_2_0(2, 0, "Grass"), - dirt_3_0(3, 0, "Dirt"), - dirt_3_1(3, 1, "Coarse Dirt"), - dirt_3_2(3, 2, "Podzol"), - cobblestone_4_0(4, 0, "Cobblestone"), - planks_5_0(5, 0, "Oak Wood Plank"), - planks_5_1(5, 1, "Spruce Wood Plank"), - planks_5_2(5, 2, "Birch Wood Plank"), - planks_5_3(5, 3, "Jungle Wood Plank"), - planks_5_4(5, 4, "Acacia Wood Plank"), - planks_5_5(5, 5, "Dark Oak Wood Plank"), - sapling_6_0(6, 0, "Oak Sapling"), - sapling_6_1(6, 1, "Spruce Sapling"), - sapling_6_2(6, 2, "Birch Sapling"), - sapling_6_3(6, 3, "Jungle Sapling"), - sapling_6_4(6, 4, "Acacia Sapling"), - sapling_6_5(6, 5, "Dark Oak Sapling"), - bedrock_7_0(7, 0, "Bedrock"), - flowing_water_8_0(8, 0, "Flowing Water"), - water_9_0(9, 0, "Still Water"), - flowing_lava_10_0(10, 0, "Flowing Lava"), - lava_11_0(11, 0, "Still Lava"), - sand_12_0(12, 0, "Sand"), - sand_12_1(12, 1, "Red Sand"), - gravel_13_0(13, 0, "Gravel"), - gold_ore_14_0(14, 0, "Gold Ore"), - iron_ore_15_0(15, 0, "Iron Ore"), - coal_ore_16_0(16, 0, "Coal Ore"), - log_17_0(17, 0, "Oak Wood"), - log_17_1(17, 1, "Spruce Wood"), - log_17_2(17, 2, "Birch Wood"), - log_17_3(17, 3, "Jungle Wood"), - leaves_18_0(18, 0, "Oak Leaves"), - leaves_18_1(18, 1, "Spruce Leaves"), - leaves_18_2(18, 2, "Birch Leaves"), - leaves_18_3(18, 3, "Jungle Leaves"), - sponge_19_0(19, 0, "Sponge"), - sponge_19_1(19, 1, "Wet Sponge"), - glass_20_0(20, 0, "Glass"), - lapis_ore_21_0(21, 0, "Lapis Lazuli Ore"), - lapis_block_22_0(22, 0, "Lapis Lazuli Block"), - dispenser_23_0(23, 0, "Dispenser"), - sandstone_24_0(24, 0, "Sandstone"), - sandstone_24_1(24, 1, "Chiseled Sandstone"), - sandstone_24_2(24, 2, "Smooth Sandstone"), - noteblock_25_0(25, 0, "Note Block"), - bed_26_0(26, 0, "Bed"), - golden_rail_27_0(27, 0, "Powered Rail"), - detector_rail_28_0(28, 0, "Detector Rail"), - sticky_piston_29_0(29, 0, "Sticky Piston"), - web_30_0(30, 0, "Cobweb"), - tallgrass_31_0(31, 0, "Dead Shrub"), - tallgrass_31_1(31, 1, "Grass"), - tallgrass_31_2(31, 2, "Fern"), - deadbush_32_0(32, 0, "Dead Shrub"), - piston_33_0(33, 0, "Piston"), - piston_head_34_0(34, 0, "Piston Head"), - wool_35_0(35, 0, "[colorNames] Wool"), - wool_35_1(35, 1, "[colorNames] Wool"), - wool_35_2(35, 2, "[colorNames] Wool"), - wool_35_3(35, 3, "[colorNames] Wool"), - wool_35_4(35, 4, "[colorNames] Wool"), - wool_35_5(35, 5, "[colorNames] Wool"), - wool_35_6(35, 6, "[colorNames] Wool"), - wool_35_7(35, 7, "[colorNames] Wool"), - wool_35_8(35, 8, "[colorNames] Wool"), - wool_35_9(35, 9, "[colorNames] Wool"), - wool_35_10(35, 10, "[colorNames] Wool"), - wool_35_11(35, 11, "[colorNames] Wool"), - wool_35_12(35, 12, "[colorNames] Wool"), - wool_35_13(35, 13, "[colorNames] Wool"), - wool_35_14(35, 14, "[colorNames] Wool"), - wool_35_15(35, 15, "[colorNames] Wool"), - yellow_flower_37_0(37, 0, "Dandelion"), - red_flower_38_0(38, 0, "Poppy"), - red_flower_38_1(38, 1, "Blue Orchid"), - red_flower_38_2(38, 2, "Allium"), - red_flower_38_3(38, 3, "Azure Bluet"), - red_flower_38_4(38, 4, "Red Tulip"), - red_flower_38_5(38, 5, "Orange Tulip"), - red_flower_38_6(38, 6, "White Tulip"), - red_flower_38_7(38, 7, "Pink Tulip"), - red_flower_38_8(38, 8, "Oxeye Daisy"), - brown_mushroom_39_0(39, 0, "Brown Mushroom"), - red_mushroom_40_0(40, 0, "Red Mushroom"), - gold_block_41_0(41, 0, "Gold Block"), - iron_block_42_0(42, 0, "Iron Block"), - double_stone_slab_43_0(43, 0, "Double Stone Slab"), - double_stone_slab_43_1(43, 1, "Double Sandstone Slab"), - double_stone_slab_43_2(43, 2, "Double Wooden Slab"), - double_stone_slab_43_3(43, 3, "Double Cobblestone Slab"), - double_stone_slab_43_4(43, 4, "Double Brick Slab"), - double_stone_slab_43_5(43, 5, "Double Stone Brick Slab"), - double_stone_slab_43_6(43, 6, "Double Nether Brick Slab"), - double_stone_slab_43_7(43, 7, "Double Quartz Slab"), - stone_slab_44_0(44, 0, "Stone Slab"), - stone_slab_44_1(44, 1, "Sandstone Slab"), - stone_slab_44_2(44, 2, "Wooden Slab"), - stone_slab_44_3(44, 3, "Cobblestone Slab"), - stone_slab_44_4(44, 4, "Brick Slab"), - stone_slab_44_5(44, 5, "Stone Brick Slab"), - stone_slab_44_6(44, 6, "Nether Brick Slab"), - stone_slab_44_7(44, 7, "Quartz Slab"), - brick_block_45_0(45, 0, "Bricks"), - tnt_46_0(46, 0, "TNT"), - bookshelf_47_0(47, 0, "Bookshelf"), - mossy_cobblestone_48_0(48, 0, "Moss Stone"), - obsidian_49_0(49, 0, "Obsidian"), - torch_50_0(50, 0, "Torch"), - fire_51_0(51, 0, "Fire"), - mob_spawner_52_0(52, 0, "Monster Spawner"), - mob_spawner_52_4(52, 4, "[entityNames] Spawner"), - mob_spawner_52_5(52, 5, "[entityNames] Spawner"), - mob_spawner_52_6(52, 6, "[entityNames] Spawner"), - mob_spawner_52_23(52, 23, "[entityNames] Spawner"), - mob_spawner_52_27(52, 27, "[entityNames] Spawner"), - mob_spawner_52_28(52, 28, "[entityNames] Spawner"), - mob_spawner_52_29(52, 29, "[entityNames] Spawner"), - mob_spawner_52_30(52, 30, "[entityNames] Spawner"), - mob_spawner_52_31(52, 31, "[entityNames] Spawner"), - mob_spawner_52_32(52, 32, "[entityNames] Spawner"), - mob_spawner_52_34(52, 34, "[entityNames] Spawner"), - mob_spawner_52_35(52, 35, "[entityNames] Spawner"), - mob_spawner_52_36(52, 36, "[entityNames] Spawner"), - mob_spawner_52_37(52, 37, "[entityNames] Spawner"), - mob_spawner_52_50(52, 50, "[entityNames] Spawner"), - mob_spawner_52_51(52, 51, "[entityNames] Spawner"), - mob_spawner_52_52(52, 52, "[entityNames] Spawner"), - mob_spawner_52_53(52, 53, "[entityNames] Spawner"), - mob_spawner_52_54(52, 54, "[entityNames] Spawner"), - mob_spawner_52_55(52, 55, "[entityNames] Spawner"), - mob_spawner_52_56(52, 56, "[entityNames] Spawner"), - mob_spawner_52_57(52, 57, "[entityNames] Spawner"), - mob_spawner_52_58(52, 58, "[entityNames] Spawner"), - mob_spawner_52_59(52, 59, "[entityNames] Spawner"), - mob_spawner_52_60(52, 60, "[entityNames] Spawner"), - mob_spawner_52_61(52, 61, "[entityNames] Spawner"), - mob_spawner_52_62(52, 62, "[entityNames] Spawner"), - mob_spawner_52_63(52, 63, "[entityNames] Spawner"), - mob_spawner_52_64(52, 64, "[entityNames] Spawner"), - mob_spawner_52_65(52, 65, "[entityNames] Spawner"), - mob_spawner_52_66(52, 66, "[entityNames] Spawner"), - mob_spawner_52_67(52, 67, "[entityNames] Spawner"), - mob_spawner_52_68(52, 68, "[entityNames] Spawner"), - mob_spawner_52_69(52, 69, "[entityNames] Spawner"), - mob_spawner_52_90(52, 90, "[entityNames] Spawner"), - mob_spawner_52_91(52, 91, "[entityNames] Spawner"), - mob_spawner_52_92(52, 92, "[entityNames] Spawner"), - mob_spawner_52_93(52, 93, "[entityNames] Spawner"), - mob_spawner_52_94(52, 94, "[entityNames] Spawner"), - mob_spawner_52_95(52, 95, "[entityNames] Spawner"), - mob_spawner_52_96(52, 96, "[entityNames] Spawner"), - mob_spawner_52_97(52, 97, "[entityNames] Spawner"), - mob_spawner_52_98(52, 98, "[entityNames] Spawner"), - mob_spawner_52_99(52, 99, "[entityNames] Spawner"), - mob_spawner_52_100(52, 100, "[entityNames] Spawner"), - mob_spawner_52_101(52, 101, "[entityNames] Spawner"), - mob_spawner_52_102(52, 102, "[entityNames] Spawner"), - mob_spawner_52_103(52, 103, "[entityNames] Spawner"), - mob_spawner_52_105(52, 105, "[entityNames] Spawner"), - mob_spawner_52_120(52, 120, "[entityNames] Spawner"), - - oak_stairs_53_0(53, 0, "Oak Wood Stairs"), - chest_54_0(54, 0, "Chest"), - redstone_wire_55_0(55, 0, "Redstone Wire"), - diamond_ore_56_0(56, 0, "Diamond Ore"), - diamond_block_57_0(57, 0, "Diamond Block"), - crafting_table_58_0(58, 0, "Crafting Table"), - wheat_59_0(59, 0, "Wheat Crops"), - farmland_60_0(60, 0, "Farmland"), - furnace_61_0(61, 0, "Furnace"), - lit_furnace_62_0(62, 0, "Burning Furnace"), - standing_sign_63_0(63, 0, "Standing Sign Block"), - wooden_door_64_0(64, 0, "Wooden Door Block"), - ladder_65_0(65, 0, "Ladder"), - rail_66_0(66, 0, "Rail"), - stone_stairs_67_0(67, 0, "Cobblestone Stairs"), - wall_sign_68_0(68, 0, "Wall-mounted Sign Block"), - lever_69_0(69, 0, "Lever"), - stone_pressure_plate_70_0(70, 0, "Stone Pressure Plate"), - iron_door_71_0(71, 0, "Iron Door Block"), - wooden_pressure_plate_72_0(72, 0, "Wooden Pressure Plate"), - redstone_ore_73_0(73, 0, "Redstone Ore"), - lit_redstone_ore_74_0(74, 0, "Glowing Redstone Ore"), - unlit_redstone_torch_75_0(75, 0, "Redstone Torch (off)"), - redstone_torch_76_0(76, 0, "Redstone Torch (on)"), - stone_button_77_0(77, 0, "Stone Button"), - snow_layer_78_0(78, 0, "Snow"), - ice_79_0(79, 0, "Ice"), - snow_80_0(80, 0, "Snow Block"), - cactus_81_0(81, 0, "Cactus"), - clay_82_0(82, 0, "Clay"), - reeds_83_0(83, 0, "Sugar Canes"), - jukebox_84_0(84, 0, "Jukebox"), - fence_85_0(85, 0, "Oak Fence"), - pumpkin_86_0(86, 0, "Pumpkin"), - netherrack_87_0(87, 0, "Netherrack"), - soul_sand_88_0(88, 0, "Soul Sand"), - glowstone_89_0(89, 0, "Glowstone"), - portal_90_0(90, 0, "Nether Portal"), - lit_pumpkin_91_0(91, 0, "Jack o'Lantern"), - cake_92_0(92, 0, "Cake Block"), - unpowered_repeater_93_0(93, 0, "Redstone Repeater Block (off)"), - powered_repeater_94_0(94, 0, "Redstone Repeater Block (on)"), - stained_glass_95_0(95, 0, "[colorNames] Stained Glass"), - stained_glass_95_1(95, 1, "[colorNames] Stained Glass"), - stained_glass_95_2(95, 2, "[colorNames] Stained Glass"), - stained_glass_95_3(95, 3, "[colorNames] Stained Glass"), - stained_glass_95_4(95, 4, "[colorNames] Stained Glass"), - stained_glass_95_5(95, 5, "[colorNames] Stained Glass"), - stained_glass_95_6(95, 6, "[colorNames] Stained Glass"), - stained_glass_95_7(95, 7, "[colorNames] Stained Glass"), - stained_glass_95_8(95, 8, "[colorNames] Stained Glass"), - stained_glass_95_9(95, 9, "[colorNames] Stained Glass"), - stained_glass_95_10(95, 10, "[colorNames] Stained Glass"), - stained_glass_95_11(95, 11, "[colorNames] Stained Glass"), - stained_glass_95_12(95, 12, "[colorNames] Stained Glass"), - stained_glass_95_13(95, 13, "[colorNames] Stained Glass"), - stained_glass_95_14(95, 14, "[colorNames] Stained Glass"), - stained_glass_95_15(95, 15, "[colorNames] Stained Glass"), - trapdoor_96_0(96, 0, "Wooden Trapdoor"), - monster_egg_97_0(97, 0, "Stone Monster Egg"), - monster_egg_97_1(97, 1, "Cobblestone Monster Egg"), - monster_egg_97_2(97, 2, "Stone Brick Monster Egg"), - monster_egg_97_3(97, 3, "Mossy Stone Brick Monster Egg"), - monster_egg_97_4(97, 4, "Cracked Stone Brick Monster Egg"), - monster_egg_97_5(97, 5, "Chiseled Stone Brick Monster Egg"), - stonebrick_98_0(98, 0, "Stone Bricks"), - stonebrick_98_1(98, 1, "Mossy Stone Bricks"), - stonebrick_98_2(98, 2, "Cracked Stone Bricks"), - stonebrick_98_3(98, 3, "Chiseled Stone Bricks"), - brown_mushroom_block_99_0(99, 0, "Brown Mushroom Cap"), - red_mushroom_block_100_0(100, 0, "Red Mushroom Cap"), - iron_bars_101_0(101, 0, "Iron Bars"), - glass_pane_102_0(102, 0, "Glass Pane"), - melon_block_103_0(103, 0, "Melon Block"), - pumpkin_stem_104_0(104, 0, "Pumpkin Stem"), - melon_stem_105_0(105, 0, "Melon Stem"), - vine_106_0(106, 0, "Vines"), - fence_gate_107_0(107, 0, "Oak Fence Gate"), - brick_stairs_108_0(108, 0, "Brick Stairs"), - stone_brick_stairs_109_0(109, 0, "Stone Brick Stairs"), - mycelium_110_0(110, 0, "Mycelium"), - waterlily_111_0(111, 0, "Lily Pad"), - nether_brick_112_0(112, 0, "Nether Brick"), - nether_brick_fence_113_0(113, 0, "Nether Brick Fence"), - nether_brick_stairs_114_0(114, 0, "Nether Brick Stairs"), - nether_wart_115_0(115, 0, "Nether Wart"), - enchanting_table_116_0(116, 0, "Enchantment Table"), - brewing_stand_117_0(117, 0, "Brewing Stand"), - cauldron_118_0(118, 0, "Cauldron"), - end_portal_119_0(119, 0, "End Portal"), - end_portal_frame_120_0(120, 0, "End Portal Frame"), - end_stone_121_0(121, 0, "End Stone"), - dragon_egg_122_0(122, 0, "Dragon Egg"), - redstone_lamp_123_0(123, 0, "Redstone Lamp (inactive)"), - lit_redstone_lamp_124_0(124, 0, "Redstone Lamp (active)"), - double_wooden_slab_125_0(125, 0, "Double Oak Wood Slab"), - double_wooden_slab_125_1(125, 1, "Double Spruce Wood Slab"), - double_wooden_slab_125_2(125, 2, "Double Birch Wood Slab"), - double_wooden_slab_125_3(125, 3, "Double Jungle Wood Slab"), - double_wooden_slab_125_4(125, 4, "Double Acacia Wood Slab"), - double_wooden_slab_125_5(125, 5, "Double Dark Oak Wood Slab"), - wooden_slab_126_0(126, 0, "Oak Wood Slab"), - wooden_slab_126_1(126, 1, "Spruce Wood Slab"), - wooden_slab_126_2(126, 2, "Birch Wood Slab"), - wooden_slab_126_3(126, 3, "Jungle Wood Slab"), - wooden_slab_126_4(126, 4, "Acacia Wood Slab"), - wooden_slab_126_5(126, 5, "Dark Oak Wood Slab"), - cocoa_127_0(127, 0, "Cocoa"), - sandstone_stairs_128_0(128, 0, "Sandstone Stairs"), - emerald_ore_129_0(129, 0, "Emerald Ore"), - ender_chest_130_0(130, 0, "Ender Chest"), - tripwire_hook_131_0(131, 0, "Tripwire Hook"), - tripwire_hook_132_0(132, 0, "Tripwire"), - emerald_block_133_0(133, 0, "Emerald Block"), - spruce_stairs_134_0(134, 0, "Spruce Wood Stairs"), - birch_stairs_135_0(135, 0, "Birch Wood Stairs"), - jungle_stairs_136_0(136, 0, "Jungle Wood Stairs"), - command_block_137_0(137, 0, "Command Block"), - beacon_138_0(138, 0, "Beacon"), - cobblestone_wall_139_0(139, 0, "Cobblestone Wall"), - cobblestone_wall_139_1(139, 1, "Mossy Cobblestone Wall"), - flower_pot_140_0(140, 0, "Flower Pot"), - carrots_141_0(141, 0, "Carrots"), - potatoes_142_0(142, 0, "Potatoes"), - wooden_button_143_0(143, 0, "Wooden Button"), - skull_144_0(144, 0, "Mob Head"), - anvil_145_0(145, 0, "Anvil"), - trapped_chest_146_0(146, 0, "Trapped Chest"), - light_weighted_pressure_plate_147_0(147, 0, "Weighted Pressure Plate (light)"), - heavy_weighted_pressure_plate_148_0(148, 0, "Weighted Pressure Plate (heavy)"), - unpowered_comparator_149_0(149, 0, "Redstone Comparator (inactive)"), - powered_comparator_150_0(150, 0, "Redstone Comparator (active)"), - daylight_detector_151_0(151, 0, "Daylight Sensor"), - redstone_block_152_0(152, 0, "Redstone Block"), - quartz_ore_153_0(153, 0, "Nether Quartz Ore"), - hopper_154_0(154, 0, "Hopper"), - quartz_block_155_0(155, 0, "Quartz Block"), - quartz_block_155_1(155, 1, "Chiseled Quartz Block"), - quartz_block_155_2(155, 2, "Pillar Quartz Block"), - quartz_stairs_156_0(156, 0, "Quartz Stairs"), - activator_rail_157_0(157, 0, "Activator Rail"), - dropper_158_0(158, 0, "Dropper"), - stained_hardened_clay_159_0(159, 0, "[colorNames] Terracotta"), - stained_hardened_clay_159_1(159, 1, "[colorNames] Terracotta"), - stained_hardened_clay_159_2(159, 2, "[colorNames] Terracotta"), - stained_hardened_clay_159_3(159, 3, "[colorNames] Terracotta"), - stained_hardened_clay_159_4(159, 4, "[colorNames] Terracotta"), - stained_hardened_clay_159_5(159, 5, "[colorNames] Terracotta"), - stained_hardened_clay_159_6(159, 6, "[colorNames] Terracotta"), - stained_hardened_clay_159_7(159, 7, "[colorNames] Terracotta"), - stained_hardened_clay_159_8(159, 8, "[colorNames] Terracotta"), - stained_hardened_clay_159_9(159, 9, "[colorNames] Terracotta"), - stained_hardened_clay_159_10(159, 10, "[colorNames] Terracotta"), - stained_hardened_clay_159_11(159, 11, "[colorNames] Terracotta"), - stained_hardened_clay_159_12(159, 12, "[colorNames] Terracotta"), - stained_hardened_clay_159_13(159, 13, "[colorNames] Terracotta"), - stained_hardened_clay_159_14(159, 14, "[colorNames] Terracotta"), - stained_hardened_clay_159_15(159, 15, "[colorNames] Terracotta"), - stained_glass_pane_160_0(160, 0, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_1(160, 1, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_2(160, 2, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_3(160, 3, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_4(160, 4, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_5(160, 5, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_6(160, 6, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_7(160, 7, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_8(160, 8, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_9(160, 9, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_10(160, 10, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_11(160, 11, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_12(160, 12, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_13(160, 13, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_14(160, 14, "[colorNames] Stained Glass Pane"), - stained_glass_pane_160_15(160, 15, "[colorNames] Stained Glass Pane"), - leaves2_161_0(161, 0, "Acacia Leaves"), - leaves2_161_1(161, 1, "Dark Oak Leaves"), - logs2_162_0(162, 0, "Acacia Wood"), - logs2_162_1(162, 1, "Dark Oak Wood"), - acacia_stairs_163_0(163, 0, "Acacia Wood Stairs"), - dark_oak_stairs_164_0(164, 0, "Dark Oak Wood Stairs"), - slime_165_0(165, 0, "Slime Block"), - barrier_166_0(166, 0, "Barrier"), - iron_trapdoor_167_0(167, 0, "Iron Trapdoor"), - prismarine_168_0(168, 0, "Prismarine"), - prismarine_168_1(168, 1, "Prismarine Bricks"), - prismarine_168_2(168, 2, "Dark Prismarine"), - sea_lantern_169_0(169, 0, "Sea Lantern"), - hay_block_170_0(170, 0, "Hay Bale"), - carpet_171_0(171, 0, "[colorNames] Carpet"), - carpet_171_1(171, 1, "[colorNames] Carpet"), - carpet_171_2(171, 2, "[colorNames] Carpet"), - carpet_171_3(171, 3, "[colorNames] Carpet"), - carpet_171_4(171, 4, "[colorNames] Carpet"), - carpet_171_5(171, 5, "[colorNames] Carpet"), - carpet_171_6(171, 6, "[colorNames] Carpet"), - carpet_171_7(171, 7, "[colorNames] Carpet"), - carpet_171_8(171, 8, "[colorNames] Carpet"), - carpet_171_9(171, 9, "[colorNames] Carpet"), - carpet_171_10(171, 10, "[colorNames] Carpet"), - carpet_171_11(171, 11, "[colorNames] Carpet"), - carpet_171_12(171, 12, "[colorNames] Carpet"), - carpet_171_13(171, 13, "[colorNames] Carpet"), - carpet_171_14(171, 14, "[colorNames] Carpet"), - carpet_171_15(171, 15, "[colorNames] Carpet"), - hardened_clay_172_0(172, 0, "Hardened Clay"), - coal_block_173_0(173, 0, "Block of Coal"), - packed_ice_174_0(174, 0, "Packed Ice"), - double_plant_175_0(175, 0, "Sunflower"), - double_plant_175_1(175, 1, "Lilac"), - double_plant_175_2(175, 2, "Double Tallgrass"), - double_plant_175_3(175, 3, "Large Fern"), - double_plant_175_4(175, 4, "Rose Bush"), - double_plant_175_5(175, 5, "Peony"), - standing_banner_176_0(176, 0, "Free-standing Banner"), - wall_banner_177_0(177, 0, "Wall-mounted Banner"), - daylight_detector_inverted_178_0(178, 0, "Inverted Daylight Sensor"), - red_sandstone_179_0(179, 0, "Red Sandstone"), - red_sandstone_179_1(179, 1, "Chiseled Red Sandstone"), - red_sandstone_179_2(179, 2, "Smooth Red Sandstone"), - red_sandstone_stairs_180_0(180, 0, "Red Sandstone Stairs"), - stone_slab2_181_0(181, 0, "Double Red Sandstone Slab"), - double_stone_slab2_182_0(182, 0, "Red Sandstone Slab"), - spruce_fence_gate_183_0(183, 0, "Spruce Fence Gate"), - birch_fence_gate_184_0(184, 0, "Birch Fence Gate"), - jungle_fence_gate_185_0(185, 0, "Jungle Fence Gate"), - dark_oak_fence_gate_186_0(186, 0, "Dark Oak Fence Gate"), - acacia_fence_gate_187_0(187, 0, "Acacia Fence Gate"), - spruce_fence_188_0(188, 0, "Spruce Fence"), - birch_fence_189_0(189, 0, "Birch Fence"), - jungle_fence_190_0(190, 0, "Jungle Fence"), - dark_oak_fence_191_0(191, 0, "Dark Oak Fence"), - acacia_fence_192_0(192, 0, "Acacia Fence"), - spruce_door_193_0(193, 0, "Spure Door Block"), - birch_door_194_0(194, 0, "Birch Door Block"), - jungle_door_195_0(195, 0, "Jungle Door Block"), - acacia_door_196_0(196, 0, "Acacia Door Block"), - dark_oak_door_197_0(197, 0, "Dark Oak Door Block"), - end_rod_198_0(198, 0, "End Rod"), - chorus_plant_199_0(199, 0, "Chorus Plant"), - chorus_flower_200_0(200, 0, "Chorus Flower"), - purpur_block_201_0(201, 0, "Purpur Block"), - purpur_pillar_202_0(202, 0, "Purpur Pillar"), - purpur_stairs_203_0(203, 0, "Purpur Stairs"), - purpur_double_slab_204_0(204, 0, "Double Purpur Slab"), - purpur_slab_205_0(205, 0, "Purpur Slab"), - end_bricks_206_0(206, 0, "End Stone Bricks"), - beetroots_207_0(207, 0, "Beetroot Block"), - grass_path_208_0(208, 0, "Grass Path"), - end_gateway_209_0(209, 0, "End Gateway Block"), - frosted_ice_212_0(212, 0, "Frosted Ice"), - magma_213_0(213, 0, "Magma Block"), - nether_wart_block_214_0(214, 0, "Nether Wart Block"), - red_nether_brick_215_0(215, 0, "Red Nether Brick"), - bone_block_216_0(216, 0, "Bone Block"), - white_shulker_box_219_0(219, 0, "White Shulker Box"), - orange_shulker_box_220_0(220, 0, "Orange Shulker Box"), - magenta_shulker_box_221_0(221, 0, "Magenta Shulker Box"), - light_blue_shulker_box_222_0(222, 0, "Light Blue Shulker Box"), - yellow_shulker_box_223_0(223, 0, "Yellow Shulker Box"), - lime_shulker_box_224_0(224, 0, "Lime Shulker Box"), - pink_shulker_box_225_0(225, 0, "Pink Shulker Box"), - gray_shulker_box_226_0(226, 0, "Gray Shulker Box"), - light_gray_shulker_box_227_0(227, 0, "Light Gray Shulker Box"), - cyan_shulker_box_228_0(228, 0, "Cyan Shulker Box"), - purple_shulker_box_229_0(229, 0, "Purple Shulker Box"), - blue_shulker_box_230_0(230, 0, "Blue Shulker Box"), - brown_shulker_box_231_0(231, 0, "Brown Shulker Box"), - green_shulker_box_232_0(232, 0, "Green Shulker Box"), - red_shulker_box_233_0(233, 0, "Red Shulker Box"), - black_shulker_box_234_0(234, 0, "Black Shulker Box"), - - white_glazed_terracotta_235_0(235, 0, "White Glazed Terracotta"), - orange_glazed_terracotta_236_0(236, 0, "Orange Glazed Terracotta"), - magenta_glazed_terracotta_237_0(237, 0, "Magenta Glazed Terracotta"), - light_blue_glazed_terracotta_238_0(238, 0, "Light Blue Glazed Terracotta"), - yellow_glazed_terracotta_239_0(239, 0, "Yellow Glazed Terracotta"), - lime_glazed_terracotta_240_0(240, 0, "Lime Glazed Terracotta"), - pink_glazed_terracotta_241_0(241, 0, "Pink Glazed Terracotta"), - gray_glazed_terracotta_242_0(242, 0, "Gray Glazed Terracotta"), - light_gray_glazed_terracotta_243_0(243, 0, "Light Gray Glazed Terracotta"), - cyan_glazed_terracotta_244_0(244, 0, "Cyan Glazed Terracotta"), - purple_glazed_terracotta_245_0(245, 0, "Purple Glazed Terracotta"), - blue_glazed_terracotta_246_0(246, 0, "Blue Glazed Terracotta"), - brown_glazed_terracotta_247_0(247, 0, "Brown Glazed Terracotta"), - green_glazed_terracotta_248_0(248, 0, "Green Glazed Terracotta"), - red_glazed_terracotta_249_0(249, 0, "Red Glazed Terracotta"), - black_glazed_terracotta_250_0(250, 0, "Black Glazed Terracotta"), - - concrete_251_0(251, 0, "[colorNames] Concrete"), - concrete_251_1(251, 1, "[colorNames] Concrete"), - concrete_251_2(251, 2, "[colorNames] Concrete"), - concrete_251_3(251, 3, "[colorNames] Concrete"), - concrete_251_4(251, 4, "[colorNames] Concrete"), - concrete_251_5(251, 5, "[colorNames] Concrete"), - concrete_251_6(251, 6, "[colorNames] Concrete"), - concrete_251_7(251, 7, "[colorNames] Concrete"), - concrete_251_8(251, 8, "[colorNames] Concrete"), - concrete_251_9(251, 9, "[colorNames] Concrete"), - concrete_251_10(251, 10, "[colorNames] Concrete"), - concrete_251_11(251, 11, "[colorNames] Concrete"), - concrete_251_12(251, 12, "[colorNames] Concrete"), - concrete_251_13(251, 13, "[colorNames] Concrete"), - concrete_251_14(251, 14, "[colorNames] Concrete"), - concrete_251_15(251, 15, "[colorNames] Concrete"), - concrete_252_0(252, 0, "[colorNames] Concrete Powder"), - concrete_252_1(252, 1, "[colorNames] Concrete Powder"), - concrete_252_2(252, 2, "[colorNames] Concrete Powder"), - concrete_252_3(252, 3, "[colorNames] Concrete Powder"), - concrete_252_4(252, 4, "[colorNames] Concrete Powder"), - concrete_252_5(252, 5, "[colorNames] Concrete Powder"), - concrete_252_6(252, 6, "[colorNames] Concrete Powder"), - concrete_252_7(252, 7, "[colorNames] Concrete Powder"), - concrete_252_8(252, 8, "[colorNames] Concrete Powder"), - concrete_252_9(252, 9, "[colorNames] Concrete Powder"), - concrete_252_10(252, 10, "[colorNames] Concrete Powder"), - concrete_252_11(252, 11, "[colorNames] Concrete Powder"), - concrete_252_12(252, 12, "[colorNames] Concrete Powder"), - concrete_252_13(252, 13, "[colorNames] Concrete Powder"), - concrete_252_14(252, 14, "[colorNames] Concrete Powder"), - concrete_252_15(252, 15, "[colorNames] Concrete Powder"), - iron_shovel_256_0(256, 0, "Iron Shovel"), - iron_pickaxe_257_0(257, 0, "Iron Pickaxe"), - iron_axe_258_0(258, 0, "Iron Axe"), - flint_and_steel_259_0(259, 0, "Flint and Steel"), - apple_260_0(260, 0, "Apple"), - bow_261_0(261, 0, "Bow"), - arrow_262_0(262, 0, "Arrow"), - coal_263_0(263, 0, "Coal"), - coal_263_1(263, 1, "Charcoal"), - diamond_264_0(264, 0, "Diamond"), - iron_ingot_265_0(265, 0, "Iron Ingot"), - gold_ingot_266_0(266, 0, "Gold Ingot"), - iron_sword_267_0(267, 0, "Iron Sword"), - wooden_sword_268_0(268, 0, "Wooden Sword"), - wooden_shovel_269_0(269, 0, "Wooden Shovel"), - wooden_pickaxe_270_0(270, 0, "Wooden Pickaxe"), - wooden_axe_271_0(271, 0, "Wooden Axe"), - stone_sword_272_0(272, 0, "Stone Sword"), - stone_shovel_273_0(273, 0, "Stone Shovel"), - stone_pickaxe_274_0(274, 0, "Stone Pickaxe"), - stone_axe_275_0(275, 0, "Stone Axe"), - diamond_sword_276_0(276, 0, "Diamond Sword"), - diamond_shovel_277_0(277, 0, "Diamond Shovel"), - diamond_pickaxe_278_0(278, 0, "Diamond Pickaxe"), - diamond_axe_279_0(279, 0, "Diamond Axe"), - stick_280_0(280, 0, "Stick"), - bowl_281_0(281, 0, "Bowl"), - mushroom_stew_282_0(282, 0, "Mushroom Stew"), - golden_sword_283_0(283, 0, "Golden Sword"), - golden_shovel_284_0(284, 0, "Golden Shovel"), - golden_pickaxe_285_0(285, 0, "Golden Pickaxe"), - golden_axe_286_0(286, 0, "Golden Axe"), - string_287_0(287, 0, "String"), - feather_288_0(288, 0, "Feather"), - gunpowder_289_0(289, 0, "Gunpowder"), - wooden_hoe_290_0(290, 0, "Wooden Hoe"), - stone_hoe_291_0(291, 0, "Stone Hoe"), - iron_hoe_292_0(292, 0, "Iron Hoe"), - diamond_hoe_293_0(293, 0, "Diamond Hoe"), - golden_hoe_294_0(294, 0, "Golden Hoe"), - wheat_seeds_295_0(295, 0, "Wheat Seeds"), - wheat_296_0(296, 0, "Wheat"), - bread_297_0(297, 0, "Bread"), - leather_helmet_298_0(298, 0, "Leather Cap"), - leather_chestplate_299_0(299, 0, "Leather Tunic"), - leather_leggings_300_0(300, 0, "Leather Pants"), - leather_boots_301_0(301, 0, "Leather Boots"), - chainmail_helmet_302_0(302, 0, "Chainmail Helmet"), - chainmail_chestplate_303_0(303, 0, "Chainmail Chestplate"), - chainmail_leggings_304_0(304, 0, "Chainmail Leggings"), - chainmail_boots_305_0(305, 0, "Chainmail Boots"), - iron_helmet_306_0(306, 0, "Iron Helmet"), - iron_chestplate_307_0(307, 0, "Iron Chestplate"), - iron_leggings_308_0(308, 0, "Iron Leggings"), - iron_boots_309_0(309, 0, "Iron Boots"), - diamond_helmet_310_0(310, 0, "Diamond Helmet"), - diamond_chestplate_311_0(311, 0, "Diamond Chestplate"), - diamond_leggings_312_0(312, 0, "Diamond Leggings"), - diamond_boots_313_0(313, 0, "Diamond Boots"), - golden_helmet_314_0(314, 0, "Golden Helmet"), - golden_chestplate_315_0(315, 0, "Golden Chestplate"), - golden_leggings_316_0(316, 0, "Golden Leggings"), - golden_boots_317_0(317, 0, "Golden Boots"), - flint_and_steel_318_0(318, 0, "Flint"), - porkchop_319_0(319, 0, "Raw Porkchop"), - cooked_porkchop_320_0(320, 0, "Cooked Porkchop"), - painting_321_0(321, 0, "Painting"), - golden_apple_322_0(322, 0, "Golden Apple"), - golden_apple_322_1(322, 1, "Enchanted Golden Apple"), - sign_323_0(323, 0, "Sign"), - wooden_door_324_0(324, 0, "Wooden Door"), - bucket_325_0(325, 0, "Bucket"), - water_bucket_326_0(326, 0, "Water Bucket"), - lava_bucket_327_0(327, 0, "Lava Bucket"), - minecart_328_0(328, 0, "Minecart"), - saddle_329_0(329, 0, "Saddle"), - iron_door_330_0(330, 0, "Iron Door"), - redstone_331_0(331, 0, "Redstone"), - snowball_332_0(332, 0, "Snowball"), - boat_333_0(333, 0, "Boat"), - leather_334_0(334, 0, "Leather"), - milk_bucket_335_0(335, 0, "Milk Bucket"), - brick_336_0(336, 0, "Brick"), - clay_ball_337_0(337, 0, "Clay Ball"), - reeds_338_0(338, 0, "Sugar Canes"), - paper_339_0(339, 0, "Paper"), - book_340_0(340, 0, "Book"), - slime_ball_341_0(341, 0, "Slimeball"), - chest_minecart_342_0(342, 0, "Minecart with Chest"), - furnace_minecart_343_0(343, 0, "Minecart with Furnace"), - egg_344_0(344, 0, "Egg"), - compass_345_0(345, 0, "Compass"), - fishing_rod_346_0(346, 0, "Fishing Rod"), - clock_347_0(347, 0, "Clock"), - glowstone_dust_348_0(348, 0, "Glowstone Dust"), - fish_349_0(349, 0, "Raw Fish"), - fish_349_1(349, 1, "Raw Salmon"), - fish_349_2(349, 2, "Clownfish"), - fish_349_3(349, 3, "Pufferfish"), - cooked_fish_350_0(350, 0, "Cooked Fish"), - cooked_fish_350_1(350, 1, "Cooked Salmon"), - dye_351_0(351, 0, "Ink Sack"), - dye_351_1(351, 1, "Rose Red"), - dye_351_2(351, 2, "Cactus Green"), - dye_351_3(351, 3, "Coco Beans"), - dye_351_4(351, 4, "Lapis Lazuli"), - dye_351_5(351, 5, "Purple Dye"), - dye_351_6(351, 6, "Cyan Dye"), - dye_351_7(351, 7, "Light Gray Dye"), - dye_351_8(351, 8, "Gray Dye"), - dye_351_9(351, 9, "Pink Dye"), - dye_351_10(351, 10, "Lime Dye"), - dye_351_11(351, 11, "Dandelion Yellow"), - dye_351_12(351, 12, "Light Blue Dye"), - dye_351_13(351, 13, "Magenta Dye"), - dye_351_14(351, 14, "Orange Dye"), - dye_351_15(351, 15, "Bone Meal"), - bone_352_0(352, 0, "Bone"), - sugar_353_0(353, 0, "Sugar"), - cake_354_0(354, 0, "Cake"), - bed_355_0(355, 0, "[colorNames] Bed"), - bed_355_1(355, 1, "[colorNames] Bed"), - bed_355_2(355, 2, "[colorNames] Bed"), - bed_355_3(355, 3, "[colorNames] Bed"), - bed_355_4(355, 4, "[colorNames] Bed"), - bed_355_5(355, 5, "[colorNames] Bed"), - bed_355_6(355, 6, "[colorNames] Bed"), - bed_355_7(355, 7, "[colorNames] Bed"), - bed_355_8(355, 8, "[colorNames] Bed"), - bed_355_9(355, 9, "[colorNames] Bed"), - bed_355_10(355, 10, "[colorNames] Bed"), - bed_355_11(355, 11, "[colorNames] Bed"), - bed_355_12(355, 12, "[colorNames] Bed"), - bed_355_13(355, 13, "[colorNames] Bed"), - bed_355_14(355, 14, "[colorNames] Bed"), - bed_355_15(355, 15, "[colorNames] Bed"), - repeater_356_0(356, 0, "Redstone Repeater"), - cookie_357_0(357, 0, "Cookie"), - filled_map_358_0(358, 0, "Map"), - shears_359_0(359, 0, "Shears"), - melon_360_0(360, 0, "Melon"), - pumpkin_seeds_361_0(361, 0, "Pumpkin Seeds"), - melon_seeds_362_0(362, 0, "Melon Seeds"), - beef_363_0(363, 0, "Raw Beef"), - cooked_beef_364_0(364, 0, "Steak"), - chicken_365_0(365, 0, "Raw Chicken"), - cooked_chicken_366_0(366, 0, "Cooked Chicken"), - rotten_flesh_367_0(367, 0, "Rotten Flesh"), - ender_pearl_368_0(368, 0, "Ender Pearl"), - blaze_rod_369_0(369, 0, "Blaze Rod"), - ghast_tear_370_0(370, 0, "Ghast Tear"), - gold_nugget_371_0(371, 0, "Gold Nugget"), - nether_wart_372_0(372, 0, "Nether Wart"), - potion_373_0(373, 0, "Potion"), - glass_bottle_374_0(374, 0, "Glass Bottle"), - spider_eye_375_0(375, 0, "Spider Eye"), - fermented_spider_eye_376_0(376, 0, "Fermented Spider Eye"), - blaze_powder_377_0(377, 0, "Blaze Powder"), - magma_cream_378_0(378, 0, "Magma Cream"), - brewing_stand_379_0(379, 0, "Brewing Stand"), - cauldron_380_0(380, 0, "Cauldron"), - ender_eye_381_0(381, 0, "Eye of Ender"), - speckled_melon_382_0(382, 0, "Glistering Melon"), - spawn_egg_383_4(383, 4, "Spawn [entityNames]"), - spawn_egg_383_5(383, 5, "Spawn [entityNames]"), - spawn_egg_383_6(383, 6, "Spawn [entityNames]"), - spawn_egg_383_23(383, 23, "Spawn [entityNames]"), - spawn_egg_383_27(383, 27, "Spawn [entityNames]"), - spawn_egg_383_28(383, 28, "Spawn [entityNames]"), - spawn_egg_383_29(383, 29, "Spawn [entityNames]"), - spawn_egg_383_30(383, 30, "Spawn [entityNames]"), - spawn_egg_383_31(383, 31, "Spawn [entityNames]"), - spawn_egg_383_32(383, 32, "Spawn [entityNames]"), - spawn_egg_383_34(383, 34, "Spawn [entityNames]"), - spawn_egg_383_35(383, 35, "Spawn [entityNames]"), - spawn_egg_383_36(383, 36, "Spawn [entityNames]"), - spawn_egg_383_37(383, 37, "Spawn [entityNames]"), - spawn_egg_383_50(383, 50, "Spawn [entityNames]"), - spawn_egg_383_51(383, 51, "Spawn [entityNames]"), - spawn_egg_383_52(383, 52, "Spawn [entityNames]"), - spawn_egg_383_53(383, 53, "Spawn [entityNames]"), - spawn_egg_383_54(383, 54, "Spawn [entityNames]"), - spawn_egg_383_55(383, 55, "Spawn [entityNames]"), - spawn_egg_383_56(383, 56, "Spawn [entityNames]"), - spawn_egg_383_57(383, 57, "Spawn [entityNames]"), - spawn_egg_383_58(383, 58, "Spawn [entityNames]"), - spawn_egg_383_59(383, 59, "Spawn [entityNames]"), - spawn_egg_383_60(383, 60, "Spawn [entityNames]"), - spawn_egg_383_61(383, 61, "Spawn [entityNames]"), - spawn_egg_383_62(383, 62, "Spawn [entityNames]"), - spawn_egg_383_63(383, 63, "Spawn [entityNames]"), - spawn_egg_383_64(383, 64, "Spawn [entityNames]"), - spawn_egg_383_65(383, 65, "Spawn [entityNames]"), - spawn_egg_383_66(383, 66, "Spawn [entityNames]"), - spawn_egg_383_67(383, 67, "Spawn [entityNames]"), - spawn_egg_383_68(383, 68, "Spawn [entityNames]"), - spawn_egg_383_69(383, 69, "Spawn [entityNames]"), - spawn_egg_383_90(383, 90, "Spawn [entityNames]"), - spawn_egg_383_91(383, 91, "Spawn [entityNames]"), - spawn_egg_383_92(383, 92, "Spawn [entityNames]"), - spawn_egg_383_93(383, 93, "Spawn [entityNames]"), - spawn_egg_383_94(383, 94, "Spawn [entityNames]"), - spawn_egg_383_95(383, 95, "Spawn [entityNames]"), - spawn_egg_383_96(383, 96, "Spawn [entityNames]"), - spawn_egg_383_97(383, 97, "Spawn [entityNames]"), - spawn_egg_383_98(383, 98, "Spawn [entityNames]"), - spawn_egg_383_99(383, 99, "Spawn [entityNames]"), - spawn_egg_383_100(383, 100, "Spawn [entityNames]"), - spawn_egg_383_101(383, 101, "Spawn [entityNames]"), - spawn_egg_383_102(383, 102, "Spawn [entityNames]"), - spawn_egg_383_103(383, 103, "Spawn [entityNames]"), - spawn_egg_383_105(383, 105, "Spawn [entityNames]"), - spawn_egg_383_120(383, 120, "Spawn [entityNames]"), - experience_bottle_384_0(384, 0, "Bottle o' Enchanting"), - fire_charge_385_0(385, 0, "Fire Charge"), - writable_book_386_0(386, 0, "Book and Quill"), - written_book_387_0(387, 0, "Written Book"), - emerald_388_0(388, 0, "Emerald"), - item_frame_389_0(389, 0, "Item Frame"), - flower_pot_390_0(390, 0, "Flower Pot"), - carrot_391_0(391, 0, "Carrot"), - potato_392_0(392, 0, "Potato"), - baked_potato_393_0(393, 0, "Baked Potato"), - poisonous_potato_394_0(394, 0, "Poisonous Potato"), - map_395_0(395, 0, "Empty Map"), - golden_carrot_396_0(396, 0, "Golden Carrot"), - skull_397_0(397, 0, "Mob Head (Skeleton)"), - skull_397_1(397, 1, "Mob Head (Wither Skeleton)"), - skull_397_2(397, 2, "Mob Head (Zombie)"), - skull_397_3(397, 3, "Mob Head (Human)"), - skull_397_4(397, 4, "Mob Head (Creeper)"), - carrot_on_a_stick_398_0(398, 0, "Carrot on a Stick"), - nether_star_399_0(399, 0, "Nether Star"), - pumpkin_pie_400_0(400, 0, "Pumpkin Pie"), - fireworks_401_0(401, 0, "Firework Rocket"), - firework_charge_402_0(402, 0, "Firework Star"), - enchanted_book_403_0(403, 0, "Enchanted Book"), - comparator_404_0(404, 0, "Redstone Comparator"), - netherbrick_405_0(405, 0, "Nether Brick"), - quartz_406_0(406, 0, "Nether Quartz"), - tnt_minecart_407_0(407, 0, "Minecart with TNT"), - hopper_minecart_408_0(408, 0, "Minecart with Hopper"), - prismarine_shard_409_0(409, 0, "Prismarine Shard"), - prismarine_crystals_410_0(410, 0, "Prismarine Crystals"), - rabbit_411_0(411, 0, "Raw Rabbit"), - cooked_rabbit_412_0(412, 0, "Cooked Rabbit"), - rabbit_stew_413_0(413, 0, "Rabbit Stew"), - rabbit_foot_414_0(414, 0, "Rabbit's Foot"), - rabbit_hide_415_0(415, 0, "Rabbit Hide"), - armor_stand_416_0(416, 0, "Armor Stand"), - iron_horse_armor_417_0(417, 0, "Iron Horse Armor"), - golden_horse_armor_418_0(418, 0, "Golden Horse Armor"), - diamond_horse_armor_419_0(419, 0, "Diamond Horse Armor"), - lead_420_0(420, 0, "Lead"), - name_tag_421_0(421, 0, "Name Tag"), - command_block_minecart_422_0(422, 0, "Minecart with Command Block"), - mutton_423_0(423, 0, "Raw Mutton"), - cooked_mutton_424_0(424, 0, "Cooked Mutton"), - banner_425_0(425, 0, "Banner"), - end_crystal_426_0(426, 0, "End Crystal"), - spruce_door_427_0(427, 0, "Spruce Door"), - birch_door_428_0(428, 0, "Birch Door"), - jungle_door_429_0(429, 0, "Jungle Door"), - acacia_door_430_0(430, 0, "Acacia Door"), - dark_oak_door_431_0(431, 0, "Dark Oak Door"), - chorus_fruit_432_0(432, 0, "Chorus Fruit"), - chorus_fruit_popped_433_0(433, 0, "Popped Chorus Fruit"), - beetroot_434_0(434, 0, "Beetroot"), - beetroot_seeds_435_0(435, 0, "Beetroot Seeds"), - beetroot_soup_436_0(436, 0, "Beetroot Soup"), - dragon_breath_437_0(437, 0, "Dragon's Breath"), - spectral_arrow_439_0(439, 0, "Spectral Arrow"), - tipped_arrow_440_0(440, 0, "Tipped Arrow"), - lingering_potion_441_0(441, 0, "Lingering Potion"), - shield_442_0(442, 0, "Shield"), - elytra_443_0(443, 0, "Elytra"), - totem_of_undying_449_0(449, 0, "Totem Of Undying"), - record_13_2256_0(2256, 0, "13 Disc"), - record_cat_2257_0(2257, 0, "Cat Disc"), - record_blocks_2258_0(2258, 0, "Blocks Disc"), - record_chirp_2259_0(2259, 0, "Chirp Disc"), - record_far_2260_0(2260, 0, "Far Disc"), - record_mall_2261_0(2261, 0, "Mall Disc"), - record_mellohi_2262_0(2262, 0, "Mellohi Disc"), - record_stal_2263_0(2263, 0, "Stal Disc"), - record_strad_2264_0(2264, 0, "Strad Disc"), - record_ward_2265_0(2265, 0, "Ward Disc"), - record_11_2266_0(2266, 0, "11 Disc"), - record_wait_2267_0(2267, 0, "Wait Disc"); - private int id; - private int data; - private String name; - - CMIMaterial(int id, int data, String name) { - this.id = id; - this.data = data; - this.name = name; - } - - public int getId() { - return id; - } - - public int getData() { - return data; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - } -} diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 0c13583c..fad63a5d 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -41,7 +41,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; -import com.gamingmesh.jobs.CmiItems.ItemManager; +import com.gamingmesh.jobs.CMILib.*; import com.gamingmesh.jobs.Gui.GuiManager; import com.gamingmesh.jobs.MyPet.MyPetManager; import com.gamingmesh.jobs.MythicMobs.MythicMobInterface; @@ -153,7 +153,7 @@ public class Jobs extends JavaPlugin { private static PermissionHandler permissionHandler; private static PermissionManager permissionManager; - private static ItemManager itemManager; +// private static ItemManager itemManager; public static BufferedPaymentThread paymentThread = null; private static DatabaseSaveThread saveTask = null; @@ -717,9 +717,9 @@ public class Jobs extends JavaPlugin { return permissionManager; } - public static ItemManager getItemManager() { - return itemManager; - } +// public static ItemManager getItemManager() { +// return itemManager; +// } /** * Sets the economy handler @@ -753,9 +753,12 @@ public class Jobs extends JavaPlugin { this.setEnabled(true); versionCheckManager = new VersionChecker(this); + + ItemManager.load(); + version = versionCheckManager.getVersion().getShortVersion(); - itemManager = new ItemManager(this); +// itemManager = new ItemManager(this); try { Class nmsClass; diff --git a/src/main/java/com/gamingmesh/jobs/NMS.java b/src/main/java/com/gamingmesh/jobs/NMS.java index 05a654c8..47dda3f8 100644 --- a/src/main/java/com/gamingmesh/jobs/NMS.java +++ b/src/main/java/com/gamingmesh/jobs/NMS.java @@ -15,7 +15,5 @@ public interface NMS { public ItemStack getItemInMainHand(Player player); - public Block getTargetBlock(Player player, int range); - void setItemInMainHand(Player player, ItemStack item); } diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 7c999b72..d81c3ce4 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -23,11 +23,12 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.UUID; import java.util.Map.Entry; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.enchantments.Enchantment; @@ -48,7 +49,6 @@ import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.ItemBonusCache; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobCommands; -import com.gamingmesh.jobs.container.JobItemBonus; import com.gamingmesh.jobs.container.JobItems; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; @@ -59,8 +59,6 @@ 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.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.PerformCommands; public class PlayerManager { @@ -796,7 +794,7 @@ public class PlayerManager { main: for (Entry one : prog.getItemBonus().entrySet()) { JobItems oneItem = one.getValue(); - if (oneItem.getId() != item.getTypeId()) + if (oneItem.getId() != item.getType().getId()) continue; if (oneItem.getName() != null && name != null) diff --git a/src/main/java/com/gamingmesh/jobs/Reflections.java b/src/main/java/com/gamingmesh/jobs/Reflections.java index aabd1aa6..876bee37 100644 --- a/src/main/java/com/gamingmesh/jobs/Reflections.java +++ b/src/main/java/com/gamingmesh/jobs/Reflections.java @@ -78,7 +78,7 @@ public class Reflections { try { Object nmsStack = asNMSCopy(item); Method itemMeth = Item.getMethod("getById", int.class); - Object res = itemMeth.invoke(Item, item.getTypeId()); + Object res = itemMeth.invoke(Item, item.getType().getId()); String ff = "b"; switch (Jobs.getVersionCheckManager().getVersion()) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/area.java b/src/main/java/com/gamingmesh/jobs/commands/list/area.java index 8a6b4c42..fd12705d 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/area.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/area.java @@ -4,16 +4,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map.Entry; -import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; + import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.config.RestrictedAreaManager; import com.gamingmesh.jobs.container.CuboidArea; import com.gamingmesh.jobs.container.RestrictedArea; -import com.gamingmesh.jobs.stuff.Debug; public class area implements Cmd { @@ -54,7 +54,7 @@ public class area implements Cmd { } if (!wg && !Jobs.getSelectionManager().hasPlacedBoth(player)) { - sender.sendMessage(Jobs.getLanguage().getMessage("command.area.output.select", "%tool%", Material.getMaterial(Jobs.getGCManager().getSelectionTooldID).name().toLowerCase())); + sender.sendMessage(Jobs.getLanguage().getMessage("command.area.output.select", "%tool%", CMIMaterial.get(Jobs.getGCManager().getSelectionTooldID).getName())); return true; } diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java b/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java index 5510c821..0fb5577b 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; +import com.gamingmesh.jobs.stuff.Util; public class blockinfo implements Cmd { @@ -26,7 +27,7 @@ public class blockinfo implements Cmd { Player player = (Player) sender; - Block block = Jobs.getNms().getTargetBlock(player, 15); + Block block = Util.getTargetBlock(player, 15); if (block == null || block.getState().getType() == Material.AIR) return true; @@ -35,9 +36,9 @@ public class blockinfo implements Cmd { sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.name", "%blockname%", block.getType().name())); - sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.id", "%blockid%", block.getTypeId())); + sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.id", "%blockid%", block.getType().getId())); sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.data", "%blockdata%", getData(block))); - sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.usage", "%first%", block.getTypeId() + dataString, + sender.sendMessage(Jobs.getLanguage().getMessage("command.blockinfo.output.usage", "%first%", block.getType().getId() + dataString, "%second%", block.getType().name() + dataString)); sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/bp.java b/src/main/java/com/gamingmesh/jobs/commands/list/bp.java index f61b4482..2409cf54 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/bp.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/bp.java @@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.BlockProtection; @@ -53,11 +54,11 @@ public class bp implements Cmd { } changedBlocks.add(l.getBlock()); if (bp.getAction() == DBAction.DELETE) - player.sendBlockChange(l, Material.STAINED_GLASS, (byte) 14); + player.sendBlockChange(l, CMIMaterial.RED_STAINED_GLASS.getMaterial(), (byte) 14); else if (time == -1) - player.sendBlockChange(l, Material.STAINED_GLASS, (byte) 15); + player.sendBlockChange(l, CMIMaterial.RED_STAINED_GLASS.getMaterial(), (byte) 15); else - player.sendBlockChange(l, Material.STAINED_GLASS, (byte) 0); + player.sendBlockChange(l, CMIMaterial.RED_STAINED_GLASS.getMaterial(), (byte) 0); } } } diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java index 06676380..537087da 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -1,5 +1,6 @@ package com.gamingmesh.jobs.commands.list; +import java.lang.reflect.InvocationTargetException; import java.util.List; import org.bukkit.Material; @@ -11,6 +12,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.ActionType; @@ -21,6 +23,7 @@ import com.gamingmesh.jobs.stuff.ChatColor; import com.gamingmesh.jobs.stuff.PageInfo; import com.gamingmesh.jobs.stuff.RawMessage; import com.gamingmesh.jobs.stuff.Util; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class editjobs implements Cmd { @@ -378,7 +381,7 @@ public class editjobs implements Cmd { break; case "looking": case "lookingat": - Block block = Jobs.getNms().getTargetBlock(player, 30); + Block block = Util.getTargetBlock(player, 30); key = block.getType().name() + "-" + block.getData(); break; } @@ -396,10 +399,10 @@ public class editjobs implements Cmd { myKey = myKey.split("-")[0]; } - Material material = Material.matchMaterial(myKey); + CMIMaterial material = CMIMaterial.get(myKey); if (material == null) - material = Material.getMaterial(myKey.replace(" ", "_").toUpperCase()); + material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase()); if (material == null) { // try integer method @@ -409,7 +412,7 @@ public class editjobs implements Cmd { } catch (NumberFormatException e) { } if (matId != null) { - material = Material.getMaterial(matId); + material = CMIMaterial.get(matId); if (material != null) { player.sendMessage(ChatColor.GOLD + "Job " + job.getName() + " " + actionT.getName() + " is using ID: " + key + "!"); player.sendMessage(ChatColor.GOLD + "Please use the Material name instead: " + material.toString() + "!"); @@ -448,12 +451,12 @@ public class editjobs implements Cmd { break; } } - if (material == Material.REDSTONE_ORE && actionT == ActionType.BREAK) { + if (material == CMIMaterial.REDSTONE_ORE && actionT == ActionType.BREAK) { player.sendMessage(ChatColor.GOLD + "Job " + job.getName() + " is using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE."); player.sendMessage(ChatColor.GOLD + "Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration."); player.sendMessage(ChatColor.GOLD + "In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with."); player.sendMessage(ChatColor.GOLD + "In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly."); - material = Material.GLOWING_REDSTONE_ORE; + material = CMIMaterial.GLOWING_REDSTONE_ORE; } type = material.toString(); @@ -518,8 +521,14 @@ public class editjobs implements Cmd { } else if (actionT == ActionType.ENCHANT) { Enchantment enchant = Enchantment.getByName(myKey); - if (enchant != null) - id = enchant.getId(); + if (enchant != null) { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrLower(Version.v1_12_R1)) { + try { + id = (int) enchant.getClass().getMethod("getId").invoke(enchant); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { + } + } + } type = myKey; } else if (actionT == ActionType.CUSTOMKILL || actionT == ActionType.SHEAR || actionT == ActionType.MMKILL) { type = myKey; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/iteminfo.java b/src/main/java/com/gamingmesh/jobs/commands/list/iteminfo.java index f6fe9a03..8363ecc0 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/iteminfo.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/iteminfo.java @@ -44,10 +44,10 @@ public class iteminfo implements Cmd { sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.name", "%itemname%", iih.getType().name())); - sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.id", "%itemid%", iih.getTypeId())); + sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.id", "%itemid%", iih.getType().getId())); if (!tool) sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.data", "%itemdata%", iih.getData().getData())); - sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.usage", "%first%", iih.getTypeId() + dataString, + sender.sendMessage(Jobs.getLanguage().getMessage("command.iteminfo.output.usage", "%first%", iih.getType().getId() + dataString, "%second%", iih.getType().name() + dataString)); sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); diff --git a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java index df05ccda..72e53797 100644 --- a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java @@ -148,7 +148,7 @@ public class BlockProtectionManager { @SuppressWarnings("deprecation") public Integer getBlockDelayTime(Block block) { - Integer time = Jobs.getRestrictedBlockManager().restrictedBlocksTimer.get(block.getTypeId()); + Integer time = Jobs.getRestrictedBlockManager().restrictedBlocksTimer.get(block.getType().getId()); if (time == null && Jobs.getGCManager().useGlobalTimer) time = Jobs.getGCManager().globalblocktimer; return time; @@ -156,6 +156,6 @@ public class BlockProtectionManager { @SuppressWarnings("deprecation") public boolean isInBp(Block block) { - return Jobs.getRestrictedBlockManager().restrictedBlocksTimer.get(block.getTypeId()) != null; + return Jobs.getRestrictedBlockManager().restrictedBlocksTimer.get(block.getType().getId()) != null; } } diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 3a9c1c6b..4f0f45b7 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -24,6 +24,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -41,6 +42,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.BoostMultiplier; import com.gamingmesh.jobs.container.CurrencyType; @@ -56,6 +58,7 @@ import com.gamingmesh.jobs.container.Quest; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; import com.gamingmesh.jobs.stuff.Debug; +import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class ConfigManager { private Jobs plugin; @@ -178,10 +181,10 @@ public class ConfigManager { myKey = myKey.split("-")[0]; } - Material material = Material.matchMaterial(myKey); + CMIMaterial material = CMIMaterial.get(myKey); if (material == null) - material = Material.getMaterial(myKey.replace(" ", "_").toUpperCase()); + material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase()); if (material == null) { // try integer method @@ -191,7 +194,7 @@ public class ConfigManager { } catch (NumberFormatException e) { } if (matId != null) { - material = Material.getMaterial(matId); + material = CMIMaterial.get(matId); if (material != null) { Jobs.getPluginLogger().warning("Job " + jobName + " " + actionType.getName() + " is using ID: " + myKey + "!"); Jobs.getPluginLogger().warning("Please use the Material name instead: " + material.toString() + "!"); @@ -242,12 +245,12 @@ public class ConfigManager { * future this hack may be removed and anybody using REDSTONE_ORE will have their * configurations broken. */ - if (material == Material.REDSTONE_ORE && actionType == ActionType.BREAK) { + if (material == CMIMaterial.REDSTONE_ORE && actionType == ActionType.BREAK) { Jobs.getPluginLogger().warning("Job " + jobName + " is using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE."); Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration."); Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with."); Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly."); - material = Material.GLOWING_REDSTONE_ORE; + material = CMIMaterial.GLOWING_REDSTONE_ORE; } // END HACK @@ -313,8 +316,14 @@ public class ConfigManager { } else if (actionType == ActionType.ENCHANT) { Enchantment enchant = Enchantment.getByName(myKey); - if (enchant != null) - id = enchant.getId(); + if (enchant != null) { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrLower(Version.v1_12_R1)) { + try { + id = (int) enchant.getClass().getMethod("getId").invoke(enchant); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { + } + } + } type = myKey; } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.SHEAR || actionType == ActionType.MMKILL) { type = myKey; @@ -531,14 +540,14 @@ public class ConfigManager { } // Gui item - ItemStack GUIitem = new ItemStack(Material.getMaterial(35), 1, (byte) 13); + ItemStack GUIitem = CMIMaterial.GREEN_WOOL.newItemStack(); if (jobSection.contains("Gui")) { ConfigurationSection guiSection = jobSection.getConfigurationSection("Gui"); if (guiSection.contains("Id") && guiSection.contains("Data") && guiSection.isInt("Id") && guiSection.isInt("Data")) { - GUIitem = new ItemStack(Material.getMaterial(guiSection.getInt("Id")), 1, (byte) guiSection.getInt("Data")); + GUIitem = CMIMaterial.get(guiSection.getInt("Id"), guiSection.getInt("Data")).newItemStack(); } else if (guiSection.contains("CustomSkull")) { String skullOwner = guiSection.getString("CustomSkull"); - GUIitem = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3); + GUIitem = CMIMaterial.PLAYER_HEAD.newItemStack(); SkullMeta skullMeta = (SkullMeta) GUIitem.getItemMeta(); if (skullOwner.length() == 36) { try { @@ -823,10 +832,10 @@ public class ConfigManager { myKey = myKey.split("-")[0]; } - Material material = Material.matchMaterial(myKey); + CMIMaterial material = CMIMaterial.get(myKey); if (material == null) - material = Material.getMaterial(myKey.replace(" ", "_").toUpperCase()); + material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase()); if (material == null) { // try integer method @@ -836,7 +845,7 @@ public class ConfigManager { } catch (NumberFormatException e) { } if (matId != null) { - material = Material.getMaterial(matId); + material = CMIMaterial.get(matId); if (material != null) { Jobs.getPluginLogger().warning("Job " + jobKey + " " + actionType.getName() + " is using ID: " + key + "!"); Jobs.getPluginLogger().warning("Please use the Material name instead: " + material.toString() + "!"); @@ -887,12 +896,12 @@ public class ConfigManager { * future this hack may be removed and anybody using REDSTONE_ORE will have their * configurations broken. */ - if (material == Material.REDSTONE_ORE && actionType == ActionType.BREAK) { + if (material == CMIMaterial.REDSTONE_ORE && actionType == ActionType.BREAK) { Jobs.getPluginLogger().warning("Job " + jobKey + " is using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE."); Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration."); Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with."); Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly."); - material = Material.GLOWING_REDSTONE_ORE; + material = CMIMaterial.GLOWING_REDSTONE_ORE; } // END HACK @@ -958,8 +967,14 @@ public class ConfigManager { } else if (actionType == ActionType.ENCHANT) { Enchantment enchant = Enchantment.getByName(myKey); - if (enchant != null) - id = enchant.getId(); + if (enchant != null) { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrLower(Version.v1_12_R1)) { + try { + id = (int) enchant.getClass().getMethod("getId").invoke(enchant); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { + } + } + } type = myKey; } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.SHEAR || actionType == ActionType.MMKILL) { type = myKey; diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index 99584e5a..1fcc80b8 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -34,6 +34,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.container.CurrencyLimit; import com.gamingmesh.jobs.container.CurrencyType; @@ -445,7 +446,7 @@ public class GeneralConfigManager { c.getW().addComment("selectionTool", "Tool used when selecting bounds for restricted area"); getSelectionTooldID = c.get("selectionTool", 294); - if (Material.getMaterial(Jobs.getGCManager().getSelectionTooldID) == null) + if (CMIMaterial.get(Jobs.getGCManager().getSelectionTooldID) == null) getSelectionTooldID = 294; c.getW().addComment("MultiServerCompatability", "Enable if you are using one data base for multiple servers across bungee network", @@ -924,7 +925,7 @@ public class GeneralConfigManager { Material tmat = Material.getMaterial(c.get("JobsGUI.BackButton.Material", "JACK_O_LANTERN")); guiBackButton = new ItemStack(tmat == null ? Material.JACK_O_LANTERN : tmat, 1, (byte) c.get("JobsGUI.BackButton.Data", 0)); tmat = Material.getMaterial(c.get("JobsGUI.Filler.Material", "STAINED_GLASS_PANE")); - guiFiller = new ItemStack(tmat == null ? Material.STAINED_GLASS_PANE : tmat, 1, (byte) c.get("JobsGUI.Filler.Data", 15)); + guiFiller = new ItemStack(tmat == null ? CMIMaterial.GREEN_STAINED_GLASS_PANE.getMaterial() : tmat, 1, (byte) c.get("JobsGUI.Filler.Data", 15)); // c.getW().addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost"); // useGlobalBoostScheduler = c.get("Schedule.Boost.Enable", false); diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java index ac5ab7c0..08ffcc69 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java @@ -9,7 +9,8 @@ import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CmiItems.CMIItem; +import com.gamingmesh.jobs.CMILib.CMIItemStack; +import com.gamingmesh.jobs.CMILib.ItemManager; import com.gamingmesh.jobs.container.LocaleReader; import com.gamingmesh.jobs.stuff.ChatColor; @@ -158,8 +159,8 @@ public class RestrictedBlockManager { for (String one : lss) { if (((c.getC().isString("blocksTimer." + one + ".id")) || (c.getC().isInt("blocksTimer." + one + ".id"))) && (c.getC().isInt("blocksTimer." + one + ".cd"))) { - CMIItem cm = Jobs.getItemManager().getItem(c.getC().getString("blocksTimer." + one + ".id")); - if ((cm == null) || (!cm.getMaterial().isBlock())) { + CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id")); + if ((cm == null) || (!cm.getCMIType().isBlock())) { Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one) .append(".id").toString()) + ") protected block id/name is not correct!"); } else { diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index 565832b9..95f120c8 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -20,6 +20,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.ItemMeta; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.container.BoostMultiplier; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobItems; @@ -123,13 +124,14 @@ public class ShopManager { for (JobItems one : item.getitems()) { @SuppressWarnings("deprecation") - Material mat = Material.getMaterial(one.getId()); + CMIMaterial mat = CMIMaterial.get(one.getId(), one.getData()); if (mat == null) continue; - ItemStack itemStack = new ItemStack(mat, one.getAmount(), (byte) one.getData()); - + ItemStack itemStack = mat.newItemStack(); + itemStack.setAmount(one.getAmount()); + ItemMeta meta = itemStack.getItemMeta(); if (one.getName() != null) @@ -238,12 +240,12 @@ public class ShopManager { ArrayList Lore = new ArrayList(); @SuppressWarnings("deprecation") - Material mat = Material.getMaterial(item.getIconId()); + CMIMaterial mat = CMIMaterial.get(item.getIconId(), item.getIconData()); if (item.isHideWithoutPerm()) { for (String onePerm : item.getRequiredPerm()) { if (!Perm.hasPermission(player, onePerm)) { - mat = Material.STONE_BUTTON; + mat = CMIMaterial.STONE_BUTTON; Lore.add(Jobs.getLanguage().getMessage("command.shop.info.NoPermToBuy")); break; } @@ -251,10 +253,11 @@ public class ShopManager { } if (mat == null) - mat = Material.STONE_BUTTON; - - ItemStack GUIitem = new ItemStack(mat, item.getIconAmount(), (byte) item.getIconData()); + mat = CMIMaterial.STONE_BUTTON; + ItemStack GUIitem = mat.newItemStack(); + GUIitem.setAmount(item.getIconAmount()); + ItemMeta meta = GUIitem.getItemMeta(); if (item.getIconName() != null) diff --git a/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java b/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java index 18d66589..38260fdc 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java +++ b/src/main/java/com/gamingmesh/jobs/container/ArmorTypes.java @@ -2,6 +2,8 @@ package com.gamingmesh.jobs.container; import org.bukkit.inventory.ItemStack; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; + public enum ArmorTypes { HELMET(5), CHESTPLATE(6), LEGGINGS(7), BOOTS(8), ELYTRA(6); @@ -15,27 +17,27 @@ public enum ArmorTypes { if (itemStack == null) return null; - switch (itemStack.getType()) { + switch (CMIMaterial.get(itemStack)) { case DIAMOND_HELMET: - case GOLD_HELMET: + case GOLDEN_HELMET: case IRON_HELMET: case CHAINMAIL_HELMET: case LEATHER_HELMET: return HELMET; case DIAMOND_CHESTPLATE: - case GOLD_CHESTPLATE: + case GOLDEN_CHESTPLATE: case IRON_CHESTPLATE: case CHAINMAIL_CHESTPLATE: case LEATHER_CHESTPLATE: return CHESTPLATE; case DIAMOND_LEGGINGS: - case GOLD_LEGGINGS: + case GOLDEN_LEGGINGS: case IRON_LEGGINGS: case CHAINMAIL_LEGGINGS: case LEATHER_LEGGINGS: return LEGGINGS; case DIAMOND_BOOTS: - case GOLD_BOOTS: + case GOLDEN_BOOTS: case IRON_BOOTS: case CHAINMAIL_BOOTS: case LEATHER_BOOTS: diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index 4ebfaf78..ead4a7ae 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -24,13 +24,13 @@ import java.util.List; import java.util.Map.Entry; import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; public class JobItems { private String node; @@ -63,7 +63,9 @@ public class JobItems { public ItemStack getItemStack(Player player, Job job) { try { - ItemStack item = new ItemStack(Material.getMaterial(id), amount, (short) data); + CMIMaterial cm = CMIMaterial.get(id, data); + ItemStack item = cm.newItemStack(); + item.setAmount(amount); ItemMeta meta = item.getItemMeta(); if (this.name != null) meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); @@ -82,7 +84,7 @@ public class JobItems { if (job != null) item = Jobs.getReflections().setNbt(item, "JobsItemBoost", job.getName(), node); - + return item; } catch (Exception e) { diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index a9d2098b..aa509f4b 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -148,7 +148,7 @@ public class JobsListener implements Listener { if (iih == null || iih.getType() == Material.AIR) return; @SuppressWarnings("deprecation") - int heldItemId = iih.getTypeId(); + int heldItemId = iih.getType().getId(); if (heldItemId != Jobs.getGCManager().getSelectionTooldID()) return; @@ -680,7 +680,7 @@ public class JobsListener implements Listener { for (JobLimitedItems oneItem : one.getJob().getLimitedItems()) { if (one.getLevel() >= oneItem.getLevel()) continue; - if (!isThisItem(oneItem, iih.getTypeId(), name, lore, enchants)) + if (!isThisItem(oneItem, iih.getType().getId(), name, lore, enchants)) continue; meinOk = one.getJob().getName(); break mein; diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 6546c06d..a8a9a890 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -20,7 +20,6 @@ package com.gamingmesh.jobs.listeners; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -32,8 +31,8 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.block.Furnace; import org.bukkit.block.BrewingStand; +import org.bukkit.block.Furnace; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Damageable; import org.bukkit.entity.Entity; @@ -52,11 +51,11 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.enchantment.EnchantItemEvent; import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityTameEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.SlimeSplitEvent; @@ -82,6 +81,7 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.projectiles.ProjectileSource; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.actions.BlockActionInfo; import com.gamingmesh.jobs.actions.CustomKillInfo; import com.gamingmesh.jobs.actions.EnchantActionInfo; @@ -95,7 +95,6 @@ import com.gamingmesh.jobs.container.ExploreRespond; import com.gamingmesh.jobs.container.FastPayment; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling; import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback; import com.google.common.base.Objects; @@ -485,7 +484,7 @@ public class JobsPaymentListener implements Listener { for (int i = 0; i < sourceItems.length; i++) { if (sourceItems[i] == null) continue; - int id = sourceItems[i].getTypeId(); + int id = sourceItems[i].getType().getId(); if (id > 0) { if (id == 351) DyeStack.add(sourceItems[i]); @@ -605,7 +604,7 @@ public class JobsPaymentListener implements Listener { return b == null; else if (b == null) return false; - return a.getTypeId() == b.getTypeId() && a.getDurability() == b.getDurability() && Objects.equal(a.getData(), b.getData()) && Objects.equal(a.getEnchantments(), b + return a.getType().getId() == b.getType().getId() && a.getDurability() == b.getDurability() && Objects.equal(a.getData(), b.getData()) && Objects.equal(a.getEnchantments(), b .getEnchantments()); } @@ -1335,7 +1334,7 @@ public class JobsPaymentListener implements Listener { if (event.isCancelled()) return; - if (block.getType() == Material.FURNACE || block.getType() == Material.BURNING_FURNACE) { + if (CMIMaterial.get(block).equals(CMIMaterial.FURNACE) || CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) { ownershipFeedback done = FurnaceBrewingHandling.registerFurnaces(event.getPlayer(), block); if (done.equals(ownershipFeedback.tooMany)) { diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java index 95c5c3d5..40d9f161 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java @@ -74,9 +74,4 @@ public class v1_10 implements NMS { player.getInventory().setItemInHand(item); } - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((Set) null, range); - } - } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java index 45ab98e5..044abad9 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java @@ -51,9 +51,4 @@ public class v1_11 implements NMS { public void setItemInMainHand(Player player, ItemStack item) { player.getInventory().setItemInMainHand(item); } - - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((Set) null, range); - } } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java index aadbc3dc..359cfa95 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java @@ -51,9 +51,4 @@ public class v1_12 implements NMS { public void setItemInMainHand(Player player, ItemStack item) { player.getInventory().setItemInMainHand(item); } - - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((Set) null, range); - } } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java new file mode 100644 index 00000000..4a78761e --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java @@ -0,0 +1,51 @@ +package com.gamingmesh.jobs.nmsUtil; + +import java.util.ArrayList; +import java.util.List; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockPistonRetractEvent; +import org.bukkit.inventory.ItemStack; + +import com.gamingmesh.jobs.NMS; + +public class v1_13 implements NMS { + @Override + public List getPistonRetractBlocks(BlockPistonRetractEvent event) { + List blocks = new ArrayList(); + blocks.addAll(event.getBlocks()); + return blocks; + } + + @Override + public String getRealType(Entity entity) { + switch (entity.getType().name()) { + case "WITHER_SKELETON": + return "skeletonwither"; + case "STRAY": + return "SkeletonStray"; + case "ZOMBIE_VILLAGER": + return "ZombieVillager"; + case "HUSK": + return "ZombieHusk"; + case "SKELETON_HORSE": + return "HorseSkeleton"; + case "ZOMBIE_HORSE": + return "HorseZombie"; + case "ELDER_GUARDIAN": + return "GuardianElder"; + } + return entity.getType().name(); + } + + @Override + public ItemStack getItemInMainHand(Player player) { + return player.getInventory().getItemInMainHand(); + } + + @Override + public void setItemInMainHand(Player player, ItemStack item) { + player.getInventory().setItemInMainHand(item); + } +} diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java index f61cabf1..1c6533a5 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java @@ -63,9 +63,4 @@ public class v1_7 implements NMS { player.getInventory().setItemInHand(item); } - @SuppressWarnings("deprecation") - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((HashSet) null, range); - } } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java index 35c509eb..7669bb81 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java @@ -69,9 +69,4 @@ public class v1_8 implements NMS { public void setItemInMainHand(Player player, ItemStack item) { player.getInventory().setItemInHand(item); } - - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((Set) null, range); - } } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java index c2a421a5..cb279413 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java @@ -68,9 +68,4 @@ public class v1_9 implements NMS { public void setItemInMainHand(Player player, ItemStack item) { player.getInventory().setItemInHand(item); } - - @Override - public Block getTargetBlock(Player player, int range) { - return player.getTargetBlock((Set) null, range); - } } diff --git a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java index d2855986..a0ab9a4e 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java @@ -16,6 +16,7 @@ import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.config.YmlMaker; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.listeners.JobsPaymentListener; @@ -246,7 +247,7 @@ public class FurnaceBrewingHandling { public static ownershipFeedback registerFurnaces(Player player, Block block) { - if (block.getType() != Material.FURNACE && block.getType() != Material.BURNING_FURNACE) { + if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) { return ownershipFeedback.invalid; } @@ -344,7 +345,7 @@ public class FurnaceBrewingHandling { if (block == null) continue; - if (block.getType() != Material.FURNACE && block.getType() != Material.BURNING_FURNACE) { + if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) { continue; } block.removeMetadata(JobsPaymentListener.furnaceOwnerMetadata, Jobs.getInstance()); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java b/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java index 668dad00..39c2dae1 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java @@ -12,10 +12,13 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; + public class GiveItem { public static boolean GiveItemForPlayer(Player player, int id, int meta, int qty, String name, List lore, HashMap hashMap) { @SuppressWarnings("deprecation") - ItemStack itemStack = new ItemStack(Material.getMaterial(id), qty, (short) meta); + ItemStack itemStack = CMIMaterial.get(id, meta).newItemStack(); + itemStack.setAmount(qty); ItemMeta ItemMeta = itemStack.getItemMeta(); if (lore != null) { diff --git a/src/main/java/com/gamingmesh/jobs/stuff/Util.java b/src/main/java/com/gamingmesh/jobs/stuff/Util.java index 3c01dcd5..3b2329f2 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/Util.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/Util.java @@ -1,17 +1,23 @@ package com.gamingmesh.jobs.stuff; +import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.UUID; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.CreatureSpawner; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BlockStateMeta; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.util.BlockIterator; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; public class Util { @@ -24,7 +30,7 @@ public class Util { public static ItemStack setEntityType(ItemStack is, EntityType type) throws IllegalArgumentException { boolean useMeta; try { - ItemStack testis = new ItemStack(Material.MOB_SPAWNER, 1); + ItemStack testis = CMIMaterial.SPAWNER.newItemStack(); ItemMeta meta = testis.getItemMeta(); useMeta = meta instanceof BlockStateMeta; } catch (Exception e) { @@ -62,4 +68,47 @@ public class Util { public static HashMap getJobsEditorMap() { return jobsEditorMap; } + + public static Block getTargetBlock(Player player, int distance, boolean ignoreNoneSolids) { + return getTargetBlock(player, null, distance, ignoreNoneSolids); + } + + public static Block getTargetBlock(Player player, int distance) { + return getTargetBlock(player, null, distance, false); + } + + public static Block getTargetBlock(Player player, Material lookingFor, int distance) { + return getTargetBlock(player, lookingFor, distance, false); + } + + public static Block getTargetBlock(Player player, Material lookingFor, int distance, boolean ignoreNoneSolids) { + if (distance > 15 * 16) + distance = 15 * 16; + if (distance < 1) + distance = 1; + ArrayList blocks = new ArrayList(); + Iterator itr = new BlockIterator(player, distance); + while (itr.hasNext()) { + Block block = itr.next(); + blocks.add(block); + if (distance != 0 && blocks.size() > distance) { + blocks.remove(0); + } + Material material = block.getType(); + + if (ignoreNoneSolids && !block.getType().isSolid()) + continue; + + if (lookingFor == null) { + if (!CMIMaterial.AIR.equals(material) && !CMIMaterial.CAVE_AIR.equals(material) && !CMIMaterial.VOID_AIR.equals(material)) { + break; + } + } else { + if (lookingFor.equals(material)) { + return block; + } + } + } + return !blocks.isEmpty() ? blocks.get(blocks.size() - 1) : null; + } } diff --git a/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java b/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java index 0400e313..3ff28fa4 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java @@ -29,50 +29,67 @@ public class VersionChecker { } public enum Version { - v1_7_R1(), - v1_7_R2(), - v1_7_R3(), - v1_7_R4(), - v1_8_R1(), - v1_8_R2(), - v1_8_R3(), - v1_9_R1(), - v1_9_R2(), - v1_10_R1(), - v1_11_R1(), - v1_11_R2(), - v1_11_R3(), - v1_12_R1(), - v1_12_R2(), - v1_12_R3(), - v1_13_R1(), - v1_13_R2(), - v1_13_R3(); + v1_7_R1(171, "v1_7"), + v1_7_R2(172, "v1_7"), + v1_7_R3(173, "v1_7"), + v1_7_R4(174, "v1_7"), + v1_8_R1(181, "v1_8"), + v1_8_R2(182, "v1_8"), + v1_8_R3(183, "v1_8"), + v1_9_R1(191, "v1_9"), + v1_9_R2(192, "v1_9"), + v1_10_R1(1101, "v1_10"), + v1_11_R1(1111, "v1_11"), + v1_11_R2(1112, "v1_11"), + v1_12_R1(1121, "v1_12"), + v1_12_R2(1122, "v1_12"), + v1_13_R1(1131, "v1_13"), + v1_13_R2(1132, "v1_13"), + v1_14_R1(1141, "v1_14"), + v1_14_R2(1142, "v1_14"), + v1_15_R1(1151, "v1_15"), + v1_15_R2(1152, "v1_15"); - private Integer value = null; - private String shortVersion = null; + private Integer value; + private String shortVersion; + + Version(Integer value, String ShortVersion) { + this.value = value; + shortVersion = ShortVersion; + } public Integer getValue() { - if (value == null) - try { - value = Integer.valueOf(this.name().replaceAll("[^\\d.]", "")); - } catch (Exception e) { - } - return this.value; + return value; } public String getShortVersion() { - if (shortVersion == null) - shortVersion = this.name().split("_R")[0]; return shortVersion; } + public static Version getCurrent() { + String[] v = Bukkit.getServer().getClass().getPackage().getName().split("\\."); + String vv = v[v.length - 1]; + for (Version one : values()) { + if (one.name().equalsIgnoreCase(vv)) + return one; + } + return null; + } + + public boolean isLower(Version version) { + return getValue() < version.getValue(); + } + public boolean isHigher(Version version) { return getValue() > version.getValue(); } - public boolean isLower(Version version) { - return getValue() < version.getValue(); + public boolean isEqualOrLower(Version version) { + return getValue() <= version.getValue(); + } + + public boolean isEqualOrHigher(Version version) { + return getValue() >= version.getValue(); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f8d3ff11..fa313d49 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,8 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.5.3 +version: 4.5.4 +api-version: 1.13 website: https://www.spigotmc.org/resources/jobs-reborn.4216/ author: phrstbrn softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet]