From cd35cc75f228448f6f44ac00cbb1b74ff5a09b60 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Wed, 1 May 2019 13:19:13 +0200 Subject: [PATCH] Initial 1.14 support --- .../jobs/CMILib/ActionBarTitleMessages.java | 109 +- .../gamingmesh/jobs/CMILib/CMIItemStack.java | 341 ++-- .../gamingmesh/jobs/CMILib/ItemManager.java | 1506 +++++++++++------ .../jobs/CMILib/ItemReflection.java | 47 - .../jobs/CMILib/VersionChecker.java | 39 +- .../jobs/config/RestrictedBlockManager.java | 6 +- .../jobs/listeners/JobsListener.java | 14 +- 7 files changed, 1304 insertions(+), 758 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java b/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java index c5577f51..e6428d20 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java @@ -115,69 +115,64 @@ public class ActionBarTitleMessages { } public static void sendTitle(final Player receivingPacket, final Object title, final Object subtitle, final int fadeIn, final int keep, final int fadeOut) { - Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), new Runnable() { - @SuppressWarnings("deprecation") - @Override - public void run() { + Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), () -> { + String t = title == null ? null : CMIChatColor.translateAlternateColorCodes((String) title); + String s = subtitle == null ? null : CMIChatColor.translateAlternateColorCodes((String) subtitle); - String t = title == null ? null : CMIChatColor.translateAlternateColorCodes((String) title); - String s = subtitle == null ? null : CMIChatColor.translateAlternateColorCodes((String) subtitle); - - if (simpleTitleMessages) { - receivingPacket.sendMessage(t); - receivingPacket.sendMessage(s); - return; - } - try { - switch (Version.getCurrent()) { - case v1_9_R1: - case v1_9_R2: - case v1_10_R1: - case v1_11_R1: - receivingPacket.sendTitle(t, s); - break; - case v1_12_R1: - case v1_13_R1: - case v1_13_R2: - case v1_14_R1: - case v1_14_R2: - case v1_15_R1: - case v1_15_R2: - receivingPacket.sendTitle(t, s, fadeIn, keep, fadeOut); - break; - case v1_7_R1: - case v1_7_R2: - case v1_7_R3: - case v1_7_R4: - case v1_8_R1: - case v1_8_R2: - case v1_8_R3: - if (title != null) { - Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), - ((Object[]) fromString.invoke(null, t))[0]); - sendPacket(receivingPacket, packetTitle); - } - if (subtitle != null) { - if (title == null) { - Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), ((Object[]) fromString.invoke(null, ""))[0]); + if (simpleTitleMessages) { + receivingPacket.sendMessage(t); + receivingPacket.sendMessage(s); + return; + } + try { + switch (Version.getCurrent()) { + case v1_9_R1: + case v1_9_R2: + case v1_10_R1: + case v1_11_R1: + receivingPacket.sendTitle(t, s); + break; + case v1_12_R1: + case v1_13_R1: + case v1_13_R2: + case v1_14_R1: + case v1_14_R2: + case v1_15_R1: + case v1_15_R2: + receivingPacket.sendTitle(t, s, fadeIn, keep, fadeOut); + break; + case v1_7_R1: + case v1_7_R2: + case v1_7_R3: + case v1_7_R4: + case v1_8_R1: + case v1_8_R2: + case v1_8_R3: + if (title != null) { + Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), + ((Object[]) fromString.invoke(null, t))[0]); sendPacket(receivingPacket, packetTitle); } - Object packetSubtitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("SUBTITLE").get(null), - ((Object[]) fromString.invoke(null, s))[0]); - sendPacket(receivingPacket, packetSubtitle); + if (subtitle != null) { + if (title == null) { + Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), ((Object[]) fromString.invoke(null, ""))[0]); + sendPacket(receivingPacket, packetTitle); + } + Object packetSubtitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("SUBTITLE").get(null), + ((Object[]) fromString.invoke(null, s))[0]); + sendPacket(receivingPacket, packetSubtitle); + } + + break; + default: + break; } - break; - default: - break; - } - - } catch (SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchFieldException ex) { - simpleTitleMessages = true; - Bukkit.getLogger().log(Level.SEVERE, "Your server can't fully support title messages. They will be shown in chat instead."); - } - return; + } catch (SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchFieldException ex) { + simpleTitleMessages = true; + Bukkit.getLogger().log(Level.SEVERE, "Your server can't fully support title messages. They will be shown in chat instead."); } + return; }); } diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java index 508af044..b599cfd8 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java @@ -1,6 +1,3 @@ -/** - * Copyright (C) 2017 Zrips - */ package com.gamingmesh.jobs.CMILib; import java.util.ArrayList; @@ -10,14 +7,17 @@ import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.Material; +import org.bukkit.block.CreatureSpawner; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionData; 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.CMILib.VersionChecker.Version; @@ -30,15 +30,19 @@ public class CMIItemStack { private String bukkitName = null; private String mojangName = null; - private CMIMaterial material = null; + private CMIMaterial cmiMaterial = null; + private Material material = null; private ItemStack item; public CMIItemStack(Material material) { - this.material = CMIMaterial.get(material); + this.material = material; + this.cmiMaterial = CMIMaterial.get(material); } - public CMIItemStack(CMIMaterial material) { - this.material = material; + public CMIItemStack(CMIMaterial cmiMaterial) { + this.cmiMaterial = cmiMaterial; + if (cmiMaterial != null) + this.material = cmiMaterial.getMaterial(); } public CMIItemStack(ItemStack item) { @@ -54,7 +58,8 @@ public class CMIItemStack { cm.setDurability(durability); cm.setBukkitName(bukkitName); cm.setMojangName(mojangName); - cm.setCMIMaterial(material); + cm.setCMIMaterial(cmiMaterial); + cm.setMaterial(material); cm.setItemStack(this.item != null ? this.item.clone() : null); return cm; } @@ -63,7 +68,7 @@ public class CMIItemStack { return id; } - public void setId(int id) { + public void setId(Integer id) { this.id = id; } @@ -73,17 +78,19 @@ public class CMIItemStack { public boolean isTool() { return getMaxDurability() > 0; - } + } public short getDurability() { - return this.getItemStack().getDurability(); + return this.getItemStack().getDurability(); } public short getMaxDurability() { - return material.getMaxDurability(); + return this.material.getMaxDurability(); } public void setData(short data) { +// CMIMaterial got = CMIMaterial.get(id, data); +// if (got != null && got.getLegacyData() == data) this.data = data; } @@ -101,7 +108,7 @@ public class CMIItemStack { public String getDisplayName() { ItemMeta meta = this.getItemStack().getItemMeta(); - return meta == null || meta.getDisplayName() == null || meta.getDisplayName().isEmpty() ? this.material.getName() : meta.getDisplayName(); + return meta == null || meta.getDisplayName() == null || meta.getDisplayName().isEmpty() ? getRealName() : meta.getDisplayName(); } public CMIItemStack addLore(String string) { @@ -110,7 +117,7 @@ public class CMIItemStack { ItemMeta meta = this.getItemStack().getItemMeta(); List lore = meta.getLore(); if (lore == null) - lore = new ArrayList<>(); + lore = new ArrayList(); lore.add(ChatColor.translateAlternateColorCodes('&', string)); meta.setLore(lore); this.getItemStack().setItemMeta(meta); @@ -139,58 +146,78 @@ public class CMIItemStack { } 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; + 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; + 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; + 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.isEmpty()) { - lore = new ArrayList<>(); - meta.setLore(lore); - } + ItemMeta meta = this.getItemStack().getItemMeta(); +// List lore = null; + if (meta != null) { + List lore = meta.getLore(); + if (lore == null) { + lore = new ArrayList(); + meta.setLore(lore); +// this.getItemStack().setItemMeta(meta); + } - return meta.getLore() == null ? new ArrayList() : meta.getLore(); - } - return new ArrayList<>(); + return meta.getLore() == null ? new ArrayList() : meta.getLore(); + } + return new ArrayList(); } public String getRealName() { - return material.getName(); + return this.getCMIType() == null || this.getCMIType() == CMIMaterial.NONE ? this.getType().name() : this.getCMIType().getName(); +// if (this.getItemStack() != null) { + // +//// String translated = CMI.getInstance().getItemManager().getTranslatedName(this.getItemStack()); +//// if (translated != null) +//// return translated; +// try { +// return CMI.getInstance().getRef().getItemMinecraftName(this.getItemStack()); +// } catch (Exception e) { +// } +// } +// return CMI.getInstance().getItemManager().getRealName(this, true).getName(); } public String getBukkitName() { - return bukkitName == null || bukkitName.isEmpty() ? null : bukkitName; + return bukkitName == null || bukkitName.isEmpty() ? null : bukkitName; } public void setBukkitName(String bukkitName) { - this.bukkitName = bukkitName; + this.bukkitName = bukkitName; } public String getMojangName() { - return mojangName == null || mojangName.isEmpty() ? null : mojangName; +// if (getCMIType().isSkull() && !Version.isCurrentEqualOrHigher(Version.v1_13_R1)) +// mojangName = "skull"; +// try { +// mojangName = CMI.getInstance().getRef().getItemMinecraftName(getItemStack()).replace("minecraft:", ""); +// } catch (Exception e) { + // +// } + return mojangName == null || mojangName.isEmpty() ? this.getCMIType().getMaterial().name() : mojangName; } public void setMojangName(String mojangName) { @@ -199,13 +226,13 @@ public class CMIItemStack { } public Material getType() { - if (material == null) - return null; - return material.getMaterial(); + if (material == null && cmiMaterial != null) + return cmiMaterial.getMaterial(); + return material; } public CMIMaterial getCMIType() { - return material; + return cmiMaterial == null ? CMIMaterial.get(material) : cmiMaterial; } @Deprecated @@ -214,31 +241,40 @@ public class CMIItemStack { } public void setMaterial(Material material) { - this.material = CMIMaterial.get(material); + this.cmiMaterial = CMIMaterial.get(material); + this.material = material; } public void setCMIMaterial(CMIMaterial material) { - this.material = material; + this.cmiMaterial = material; + this.material = material == null ? null : material.getMaterial(); } @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); + if (cmiMaterial.isMonsterEgg()) { + if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { + this.item = new ItemStack(this.getType()); + this.item.setAmount(this.getAmount()); + } else + this.item = new ItemStack(this.getType(), this.amount == 0 ? 1 : this.amount, data == 0 ? (short) 90 : data); } else { - this.item = new ItemStack(material.getMaterial(), this.amount == 0 ? 1 : this.amount, data); + if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { + this.item = new ItemStack(this.getType()); + this.item.setAmount(this.getAmount()); + } else + this.item = new ItemStack(this.getType(), 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")) { + if (this.getCMIType().isPotion() || 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); + potion.addCustomEffect(new PotionEffect(effect, 60, 0), true); } item.setItemMeta(potion); item.setDurability((short) 0); - potion = (PotionMeta) item.getItemMeta(); potion.setDisplayName(this.getRealName()); item.setItemMeta(potion); @@ -249,44 +285,48 @@ public class CMIItemStack { @SuppressWarnings("deprecation") public CMIItemStack setItemStack(ItemStack item) { - this.item = item; + this.item = item == null ? null : 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(); + this.material = item.getType(); + this.cmiMaterial = CMIMaterial.get(this.material); + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) + this.id = item.getType().getId(); + else if (cmiMaterial != null) { + this.id = cmiMaterial.getId(); } - if (item.getType().getMaxDurability() - item.getDurability() < 0) { + if ((this.getType().isBlock() || this.getType().isSolid())) data = item.getData().getData(); - } - if (item.getType().getMaxDurability() > 15) { + 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 meta = (PotionMeta) item.getItemMeta(); - if (meta instanceof PotionMeta) { - PotionMeta potionMeta = (PotionMeta) meta; - try { - if (potionMeta != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData().getType().getEffectType() != null) { - data = (short) potionMeta.getBasePotionData().getType().getEffectType().getId(); - } - } catch (NoSuchMethodError e) { - } - } + if (CMIMaterial.SPAWNER.equals(item.getType())) + data = getEntityType().getTypeId(); + else 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; + return amount <= 0 ? 1 : amount; } public void setAmount(int amount) { this.amount = amount; + if (item != null) + this.item.setAmount(this.amount == 0 ? item.getAmount() : this.amount); } public boolean isSimilar(ItemStack item) { @@ -296,54 +336,117 @@ public class CMIItemStack { public boolean isSimilar(CMIItemStack item) { if (item == null) return false; - return this.material.equals(item.material) && this.getData() == item.getData(); + + try { + if ((item.getCMIType().isPotion() || item.getCMIType().equals(CMIMaterial.TIPPED_ARROW)) && + (this.getCMIType().isPotion() || this.getCMIType().equals(CMIMaterial.TIPPED_ARROW)) && + this.getType().equals(item.getType())) { + PotionMeta potion = (PotionMeta) item.getItemStack().getItemMeta(); + PotionMeta potion2 = (PotionMeta) this.getItemStack().getItemMeta(); + try { + if (potion != null && potion.getBasePotionData() != null) { + PotionData base1 = potion.getBasePotionData(); + if (base1.getType() != null) { + if (potion2 != null && potion2.getBasePotionData() != null) { + PotionData base2 = potion2.getBasePotionData(); + if (base2.getType() != null) { + if (base1.getType().equals(base2.getType()) && base1.isExtended() == base2.isExtended() && base1.isUpgraded() == base2.isUpgraded()) + return true; + } + } + } + } + return false; + } catch (NoSuchMethodError e) { + } + } + } catch (Throwable e) { + e.printStackTrace(); + } + try { + if (this.getItemStack().getItemMeta() instanceof EnchantmentStorageMeta && item.getItemStack().getItemMeta() instanceof EnchantmentStorageMeta) { + EnchantmentStorageMeta meta1 = (EnchantmentStorageMeta) this.getItemStack().getItemMeta(); + EnchantmentStorageMeta meta2 = (EnchantmentStorageMeta) item.getItemStack().getItemMeta(); + + for (Entry one : meta1.getEnchants().entrySet()) { + if (!meta2.getEnchants().containsKey(one.getKey()) || meta2.getEnchants().get(one.getKey()) != one.getValue()) + return false; + } + + for (Entry one : meta1.getStoredEnchants().entrySet()) { + if (!meta2.getStoredEnchants().containsKey(one.getKey()) || meta2.getStoredEnchants().get(one.getKey()) != one.getValue()) + return false; + } + } + } catch (Throwable e) { + e.printStackTrace(); + } + + if ((item.getCMIType() == CMIMaterial.SPAWNER || item.getCMIType().isMonsterEgg()) && (getCMIType() == CMIMaterial.SPAWNER || getCMIType().isMonsterEgg())) { + if (this.cmiMaterial != item.cmiMaterial) + return false; + if (getEntityType() != item.getEntityType()) + return false; + return true; + } + + if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) + return this.cmiMaterial == item.cmiMaterial; + return this.cmiMaterial == item.cmiMaterial && this.getData() == item.getData(); } -// public boolean hasNbtTag() { -// return CMI.getInstance().getRef().hasNbt(this.getItemStack()); -// } + public EntityType getEntityType() { + if (this.getItemStack() == null) + return null; + ItemStack is = this.getItemStack().clone(); + if (is.getItemMeta() instanceof org.bukkit.inventory.meta.BlockStateMeta) { + org.bukkit.inventory.meta.BlockStateMeta bsm = (org.bukkit.inventory.meta.BlockStateMeta) is.getItemMeta(); + if (bsm.getBlockState() instanceof CreatureSpawner) { + CreatureSpawner bs = (CreatureSpawner) bsm.getBlockState(); + return bs.getSpawnedType(); + } + } -// 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; -// } + return EntityType.fromId(is.getData().getData()); + } 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; -// } + public String toOneLiner() { + String liner = this.getType().toString(); + if (this.getCMIType().isPotion() || this.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) { + liner += ":" + potion.getBasePotionData().getType().getEffectType().getName() + "-" + potion.getBasePotionData().isUpgraded() + "-" + potion.getBasePotionData().isExtended(); + } + } catch (NoSuchMethodError e) { + } + } else { + if (Version.isCurrentLower(Version.v1_13_R1)) + liner += ":" + this.getData(); + } + if (this.getItemStack().getItemMeta() instanceof EnchantmentStorageMeta) { + EnchantmentStorageMeta meta = (EnchantmentStorageMeta) this.getItemStack().getItemMeta(); + String s = ""; + for (Entry one : meta.getStoredEnchants().entrySet()) { + if (!s.isEmpty()) + s += ";"; + s += one.getKey().getName() + "x" + one.getValue(); + } + + for (Entry one : meta.getEnchants().entrySet()) { + if (!s.isEmpty()) + s += ";"; + s += one.getKey().getName() + "x" + one.getValue(); + } + if (!s.isEmpty()) + liner += ":" + s; + } + + return liner; + } } diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index 17afac1b..15fc0f6c 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -3,6 +3,7 @@ */ package com.gamingmesh.jobs.CMILib; +import java.awt.Color; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,11 +16,16 @@ import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; +import org.bukkit.block.CreatureSpawner; import org.bukkit.block.Skull; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.meta.BlockStateMeta; +import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; import com.gamingmesh.jobs.CMILib.VersionChecker.Version; @@ -30,9 +36,9 @@ public class ItemManager { static HashMap byBukkitName = new HashMap<>(); static HashMap byMojangName = new HashMap<>(); static HashMap byMaterial = new HashMap<>(); + static HashMap byRealMaterial = new HashMap(); static final Version version = Version.getCurrent(); - @SuppressWarnings("deprecation") public static void load() { for (CMIMaterial one : CMIMaterial.values()) { if (one == null) @@ -40,56 +46,61 @@ public class ItemManager { one.updateMaterial(); Material mat = one.getMaterial(); - if (mat == null) { + if (mat == null) continue; - } - int id = one.getId(); - int data = one.getLegacyData(); - int legacyId = one.getLegacyId(); + Integer id = one.getId(); + short data = one.getLegacyData(); + Integer legacyId = one.getLegacyId(); String bukkitName = one.name(); String mojangName = one.name(); + ; try { mojangName = ItemReflection.getItemMinecraftName(new ItemStack(mat)); } catch (Throwable e) { + e.printStackTrace(); } + + mojangName = mojangName == null ? mat.toString() : mojangName; CMIItemStack cm = new CMIItemStack(one); cm.setId(id); - cm.setData((short) (data > 0 ? data : 0)); + cm.setData(data > 0 ? data : 0); cm.setBukkitName(bukkitName); cm.setMojangName(mojangName); - byBukkitName.put(id + ":" + one.getData(), cm); - byBukkitName.put(legacyId + ":" + one.getLegacyData(), cm); + byBukkitName.put(bukkitName + ":" + cm.getData(), cm); + 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); - if (mojangName != null) { - String n = mojangName.toLowerCase().replace("_", "").replace(" ", "").replace("minecraft:", ""); - if (!byMojangName.containsKey(n)) - byMojangName.put(n, 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); + if (one.getLegacyData() == 0) + byId.put(one.getLegacyId(), cm); + byRealMaterial.put(mat, one); } for (Material one : Material.class.getEnumConstants()) { CMIMaterial mat = CMIMaterial.get(one); - if (mat == null && !one.toString().startsWith("LEGACY_")) { + if (mat == CMIMaterial.NONE && !one.toString().startsWith("LEGACY_")) { CMIItemStack cm = new CMIItemStack(new ItemStack(one)); - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) cm.setId(one.getId()); cm.setBukkitName(one.name()); - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) byBukkitName.put(one.getId() + ":" + cm.getData(), cm); byBukkitName.put(one.name().toLowerCase().replace("_", "").replace(" ", ""), cm); String mojangName = one.name(); @@ -97,46 +108,60 @@ public class ItemManager { mojangName = ItemReflection.getItemMinecraftName(new ItemStack(one)); } catch (Throwable e) { } + mojangName = mojangName == null ? mat.toString() : mojangName; 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); + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) + if (!byId.containsKey(one.getId())) + byId.put(one.getId(), cm); + byRealMaterial.put(one, mat); } } - } +} @Deprecated - public static CMIItemStack getItem(Material mat) { + public 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(); + return cm == null ? null : cm.clone(); } public static CMIItemStack getItem(ItemStack item) { if (item == null) item = new ItemStack(Material.AIR); CMIItemStack cm = getItem(CMIMaterial.get(item)); + if (cm == null) + return new CMIItemStack(Material.AIR); cm.setItemStack(item); return cm; } - static HashMap headCache = new HashMap<>(); + HashMap headCache = new HashMap(); - @SuppressWarnings("deprecation") - public static CMIItemStack getItem(String name) { - if (byBukkitName.isEmpty()) - load(); + public CMIItemStack getItem(String name) { +// if (byBukkitName.isEmpty()) +// load(); CMIItemStack cm = null; - name = name.toLowerCase().replace("_", "").replace("minecraft:", ""); + name = name.toLowerCase().replace("minecraft:", ""); String original = name; + name = name.replace("_", ""); Integer amount = null; + + String subdata = null; + if (name.contains(":")) { + CMIItemStack mat = byBukkitName.get(name); + if (mat != null) + return mat; + subdata = name.split(":")[1]; + } + if (name.contains("-")) { String a = name.split("-")[1]; try { @@ -156,7 +181,7 @@ public class ItemManager { try { CMIEntityType e = CMIEntityType.getByName(name.split(":")[1]); if (e != null) - data = e.getType().getTypeId(); + data = (short) e.getId(); } catch (Throwable e) { } name = name.split(":")[0]; @@ -180,7 +205,7 @@ public class ItemManager { cm.setItemStack(old); } else { String d = original.split(":")[1]; - ItemStack skull = new ItemStack(CMIMaterial.PLAYER_HEAD.getMaterial(), 1, (byte) 3); + ItemStack skull = CMIMaterial.PLAYER_HEAD.newItemStack(); SkullMeta skullMeta = (SkullMeta) skull.getItemMeta(); if (d.length() == 36) { try { @@ -202,8 +227,35 @@ public class ItemManager { break; } - if (cm == null) { + main: if (cm == null) { cm = byBukkitName.get(name); + if (subdata != null && cm != null) { + cm = byBukkitName.get(cm.getCMIType() + ":" + subdata); + if (cm != null) + break main; + } + cm = byBukkitName.get(name); + + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + if (cm != null && data != -999) { + CMIMaterial t = CMIMaterial.get(cm.getCMIType().getLegacyId(), data); + if (t != null) { + cm = byMaterial.get(t); + } + } + } + + if (data != -999) { + try { + cm = byId.get(Integer.parseInt(name)); + CMIMaterial t = CMIMaterial.get(original); + if (t != null) { + cm = byMaterial.get(t); + } + } catch (Throwable e) { + } + } + if (cm == null) { try { cm = byId.get(Integer.parseInt(name)); @@ -264,6 +316,7 @@ public class ItemManager { } } } +// } } } } @@ -281,11 +334,62 @@ public class ItemManager { } if (ncm != null && amount != null) ncm.setAmount(amount); + + if (ncm != null && subdata != null) { + + if (ncm.getCMIType().isPotion() || ncm.getCMIType().equals(CMIMaterial.SPLASH_POTION) || ncm.getCMIType().equals(CMIMaterial.TIPPED_ARROW)) { + Integer d = null; + PotionEffectType type = null; + Boolean upgraded = false; + Boolean extended = false; + String[] split = subdata.split("-"); + try { + d = Integer.parseInt(split.length > 0 ? split[0] : subdata); + type = PotionEffectType.getById(d); + } catch (Throwable e) { + } + try { + + String n = (split.length > 0 ? split[0] : subdata).replace("_", ""); + for (PotionEffectType one : PotionEffectType.values()) { + if (one == null) + continue; + if (n.equalsIgnoreCase(one.getName().replace("_", ""))) { + type = one; + break; + } + } + + if (split.length > 1) { + try { + upgraded = Boolean.parseBoolean(split[1]); + } catch (Throwable e) { + } + } + if (split.length > 2) { + try { + extended = Boolean.parseBoolean(split[2]); + } catch (Throwable e) { + } + } + ItemStack item = ncm.getItemStack(); + if (extended && upgraded) + extended = false; + PotionMeta meta = (PotionMeta) item.getItemMeta(); + meta.setBasePotionData(new PotionData(PotionType.getByEffect(type), extended, upgraded)); + item.setItemMeta(meta); + } catch (Throwable e) { + e.printStackTrace(); + } + + } + } + return ncm; } - static public List getAllRecipes() { - List results = new ArrayList<>(); + public List getAllRecipes() { + List results = new ArrayList(); Iterator iter = Bukkit.recipeIterator(); while (iter.hasNext()) { Recipe recipe = iter.next(); @@ -294,9 +398,8 @@ public class ItemManager { return results; } - static public List getRecipesFor(ItemStack result) { - - List results = new ArrayList<>(); + public List getRecipesFor(ItemStack result) { + List results = new ArrayList(); Iterator iter = Bukkit.recipeIterator(); while (iter.hasNext()) { Recipe recipe = iter.next(); @@ -311,38 +414,54 @@ public class ItemManager { return results; } - @SuppressWarnings("deprecation") - static public Material getMaterial(String name) { + public Material getMaterial(String name) { CMIItemStack cm = getItem(name); if (cm == null) return Material.AIR; - return cm.getMaterial(); + return cm.getType(); } - public enum colorNames { - White(0, "White"), - Orange(1, "Orange"), - Magenta(2, "Magenta"), - Navy(3, "Navy Blue"), - Yellow(4, "Yellow"), - Lime(5, "Lime Green"), - Pink(6, "Pink"), - Gray(7, "Gray"), - Silver(8, "Silver"), - Cyan(9, "Cyan"), - Purple(10, "Purple"), - Blue(11, "Blue"), - Brown(12, "Brown"), - Green(13, "Green"), - Red(14, "Red"), - Black(15, "Black"); + public enum SlabType { + TOP, + BOTTOM, + DOUBLE, + NOTSLAB; + } + + public enum CMIColors { + White(0, "White", CMIMaterial.BONE_MEAL, new Color(249, 255, 254)), + Orange(1, "Orange", CMIMaterial.ORANGE_DYE, new Color(249, 128, 29)), + Magenta(2, "Magenta", CMIMaterial.MAGENTA_DYE, new Color(199, 78, 189)), + Navy(3, "Navy", CMIMaterial.LIGHT_BLUE_DYE, new Color(58, 179, 218)), + Yellow(4, "Yellow", CMIMaterial.DANDELION_YELLOW, new Color(254, 216, 61)), + Lime(5, "Lime", CMIMaterial.LIME_DYE, new Color(128, 199, 31)), + Pink(6, "Pink", CMIMaterial.PINK_DYE, new Color(243, 139, 170)), + Gray(7, "Gray", CMIMaterial.GRAY_DYE, new Color(71, 79, 82)), + Silver(8, "Silver", CMIMaterial.LIGHT_GRAY_DYE, new Color(157, 157, 151)), + Cyan(9, "Cyan", CMIMaterial.CYAN_DYE, new Color(22, 156, 156)), + Purple(10, "Purple", CMIMaterial.PURPLE_DYE, new Color(137, 50, 184)), + Blue(11, "Blue", CMIMaterial.LAPIS_LAZULI, new Color(60, 68, 170)), + Brown(12, "Brown", CMIMaterial.COCOA_BEANS, new Color(131, 84, 50)), + Green(13, "Green", CMIMaterial.CACTUS_GREEN, new Color(94, 124, 22)), + Red(14, "Red", CMIMaterial.ROSE_RED, new Color(176, 46, 38)), + Black(15, "Black", CMIMaterial.INK_SAC, new Color(29, 29, 33)); private int id; private String name; + private CMIMaterial mat; + private Color color; - colorNames(int id, String name) { + CMIColors(int id, String name, CMIMaterial mat, Color color) { this.id = id; this.name = name; + this.mat = mat; + this.color = color; + } + + CMIColors(int id, String name, CMIMaterial mat) { + this.id = id; + this.name = name; + this.mat = mat; } public int getId() { @@ -353,14 +472,46 @@ public class ItemManager { return name; } - public static colorNames getById(int id) { - for (colorNames one : colorNames.values()) { + public static CMIColors getById(int id) { + for (CMIColors one : CMIColors.values()) { if (one.getId() == id) return one; } - return colorNames.White; + return CMIColors.White; } - } + + public CMIMaterial getMat() { + return mat; + } + + public void setMat(CMIMaterial mat) { + this.mat = mat; + } + + public static CMIMaterial getColorMaterial(CMIMaterial mat) { + String name = mat.getName().replace(" ", "").replace("_", "").toLowerCase(); + for (CMIColors one : values()) { + if (name.contains(one.getName().replace("_", "").toLowerCase())) + return one.getMat(); + } + + return null; + } + + public static CMIColors getColor(CMIMaterial mat) { + String name = mat.getName().replace(" ", "").replace("_", "").toLowerCase(); + for (CMIColors one : values()) { + if (name.contains(one.getName().replace("_", "").toLowerCase())) + return one; + } + + return null; + } + + public Color getColor() { + return color; + } +} public enum CMIPotionType { Awkward(373, 16, "Awkard Potion"), @@ -409,13 +560,11 @@ public class ItemManager { Water(373, 0, "Water Potion"); private int id; - private int subId; private String name; PotionType type = null; - CMIPotionType(int id, int subId, String name) { + CMIPotionType(int id, String name) { this.id = id; - this.subId = subId; this.name = name; } @@ -423,10 +572,6 @@ public class ItemManager { return id; } - public int getSubId() { - return subId; - } - public String getName() { return name; } @@ -552,7 +697,6 @@ public class ItemManager { } public enum CMIEntityType { - PLAYER(-1, "Player"), DROPPED_ITEM(1, "Item"), EXPERIENCE_ORB(2, "Experience Orb"), AREA_EFFECT_CLOUD(3, "Area Effect Cloud"), @@ -590,7 +734,6 @@ public class ItemManager { 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"), @@ -605,7 +748,6 @@ public class ItemManager { 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"), @@ -624,7 +766,7 @@ public class ItemManager { CHICKEN(93, "Chicken"), SQUID(94, "Squid"), WOLF(95, "Wolf"), - MUSHROOM_COW(96, "Mushroom Cow"), + MUSHROOM_COW(96, "Mushroom Cow", "Mooshroom"), SNOWMAN(97, "Snowman"), OCELOT(98, "Ocelot"), IRON_GOLEM(99, "Iron Golem"), @@ -649,17 +791,31 @@ public class ItemManager { FISHING_HOOK(911, "Fishing Hook"), LIGHTNING(912, "Lightning Bolt"), WEATHER(913, "Weather"), + PLAYER(914, "Player"), COMPLEX_PART(915, "Complex Part"), TIPPED_ARROW(916, "Tipped Arrow"), + + PANDA(916, "Panda"), + PILLAGER(916, "Pillager"), + RAVAGER(916, "Ravager"), + TRADER_LLAMA(916, "Trader Llama"), + WANDERING_TRADER(916, "Wandering Trader"), + FOX(916, "Fox"), UNKNOWN(999, "Unknown"); private int id; private String name; + private String secondaryName; EntityType type = null; CMIEntityType(int id, String name) { + this(id, name, null); + } + + CMIEntityType(int id, String name, String secondaryName) { this.id = id; this.name = name; + this.secondaryName = secondaryName; } public int getId() { @@ -670,10 +826,6 @@ public class ItemManager { return name; } - public String getOneWordName() { - return name.replace(" ", ""); - } - public static CMIEntityType getById(int id) { for (CMIEntityType one : CMIEntityType.values()) { if (one.getId() == id) @@ -686,6 +838,27 @@ public class ItemManager { return getByName(entity.toString()); } + public static CMIEntityType getByItem(ItemStack item) { + if (item == null) + return null; + + if (CMIMaterial.isMonsterEgg(item.getType())) { + String name = item.getType().toString().replace("_SPAWN_EGG", ""); + return getByName(name); + } + + if (CMIMaterial.SPAWNER.equals(item.getType())) { + if (item.getItemMeta() instanceof BlockStateMeta) { + BlockStateMeta bsm = (BlockStateMeta) item.getItemMeta(); + if (bsm.getBlockState() instanceof CreatureSpawner) { + CreatureSpawner bs = (CreatureSpawner) bsm.getBlockState(); + return CMIEntityType.getByType(bs.getSpawnedType()); + } + } + } + return null; + } + public static CMIEntityType getByName(String name) { String main = name; String sub = null; @@ -760,6 +933,18 @@ public class ItemManager { break; } } + if (type == null) + for (CMIEntityType one : CMIEntityType.values()) { + if (one.secondaryName == null) + continue; + + String oneN = one.secondaryName; + oneN = oneN.replace("_", ""); + if (oneN.equalsIgnoreCase(name)) { + type = one; + break; + } + } return type; } @@ -796,45 +981,45 @@ public class ItemManager { name = name.substring(0, 1).toUpperCase() + name.substring(1); return name; } + + public CMIMaterial getSpawnEggMaterial() { + CMIMaterial m = CMIMaterial.get((this.equals(CMIEntityType.MUSHROOM_COW) ? "Mooshroom".toLowerCase() : this.toString().toLowerCase()) + "_spawn_egg"); + + if (m != null && m.isMonsterEgg()) + return m; + + return null; + } } - public static enum CMIMaterial { - NONE(-1, -1, -1, "None"), + public enum CMIMaterial { + NONE(null, null, null, "None"), ACACIA_BOAT(447, 0, 27326, "Acacia Boat", "BOAT_ACACIA"), - ACACIA_BUTTON(-1, -1, 13993, "Acacia Button"), + ACACIA_BUTTON(null, null, 13993, "Acacia Button"), ACACIA_DOOR(430, 0, 23797, "Acacia Door", "ACACIA_DOOR_ITEM"), ACACIA_FENCE(192, 0, 4569, "Acacia Fence"), ACACIA_FENCE_GATE(187, 0, 14145, "Acacia Fence Gate"), ACACIA_LEAVES(161, 0, 16606, "Acacia Leaves", "LEAVES_2"), ACACIA_LOG(162, 0, 8385, "Acacia Log", "LOG_2"), ACACIA_PLANKS(5, 4, 31312, "Acacia Wood Plank", "Acacia Planks"), - ACACIA_PRESSURE_PLATE(-1, -1, 17586, "Acacia Pressure Plate"), + ACACIA_PRESSURE_PLATE(null, null, 17586, "Acacia Pressure Plate"), ACACIA_SAPLING(6, 4, 20806, "Acacia Sapling"), - ACACIA_SIGN(-1, -1, 88348, "Acacia Sign"), ACACIA_SLAB(126, 4, 23730, "Acacia Wood Slab", "Acacia Slab"), ACACIA_STAIRS(163, 0, 17453, "Acacia Stairs"), - ACACIA_TRAPDOOR(-1, -1, 18343, "Acacia Trapdoor"), - ACACIA_WALL_SIGN(-1, -1, 44678, "Acacia Wall Sign"), - ACACIA_WOOD(-1, -1, 21861, "Acacia Wood"), - ACACIA_WOOD_BARK(-1, -1, 156, "Acacia Wood With Bark"), + ACACIA_TRAPDOOR(null, null, 18343, "Acacia Trapdoor"), + ACACIA_WOOD(null, null, 21861, "Acacia Wood"), ACTIVATOR_RAIL(157, 0, 5834, "Activator Rail"), AIR(0, 0, 9648, "Air"), ALLIUM(38, 2, 6871, "Allium", "RED_ROSE"), ANDESITE(1, 5, 25975, "Andesite"), - ANDESITE_SLAB(-1, -1, 77896, "Andesite Slab"), - ANDESITE_STAIRS(-1, -1, 45787, "Andesite Stairs"), - ANDESITE_WALL(-1, -1, 99576, "Andesite Wall"), ANVIL(145, 0, 18718, "Anvil"), APPLE(260, 0, 7720, "Apple"), ARMOR_STAND(416, 0, 12852, "Armor Stand"), ARROW(262, 0, 31091, "Arrow"), - ATTACHED_MELON_STEM(-1, -1, 30882, "Attached Melon Stem"), - ATTACHED_PUMPKIN_STEM(-1, -1, 12724, "Attached Pumpkin Stem"), + ATTACHED_MELON_STEM(null, null, 30882, "Attached Melon Stem"), + ATTACHED_PUMPKIN_STEM(null, null, 12724, "Attached Pumpkin Stem"), AZURE_BLUET(38, 3, 17608, "Azure Bluet"), BAKED_POTATO(393, 0, 14624, "Baked Potato"), - BAMBOO(-1, -1, 32454, "Bamboo"), - BAMBOO_SAPLING(-1, -1, 12154, "Bamboo Sapling"), - BARREL(-1, -1, 1125, "Barrel"), BARRIER(166, 0, 26453, "Barrier"), BAT_SPAWN_EGG(383, 65, 14607, "Spawn Bat", "Bat Spawn Egg"), BEACON(138, 0, 6608, "Beacon"), @@ -844,49 +1029,42 @@ public class ItemManager { BEETROOTS(207, 0, 22075, "Beetroots", "BEETROOT_BLOCK"), BEETROOT_SEEDS(435, 0, 21282, "Beetroot Seeds"), BEETROOT_SOUP(436, 0, 16036, "Beetroot Soup"), - BELL(-1, -1, 15777, "Bell"), BIRCH_BOAT(445, 0, 28104, "Birch Boat", "BOAT_BIRCH"), - BIRCH_BUTTON(-1, -1, 26934, "Birch Button"), + BIRCH_BUTTON(null, null, 26934, "Birch Button"), BIRCH_DOOR(428, 0, 14759, "Birch Door", "BIRCH_DOOR_ITEM"), BIRCH_FENCE(189, 0, 17347, "Birch Fence"), BIRCH_FENCE_GATE(184, 0, 6322, "Birch Fence Gate"), BIRCH_LEAVES(18, 2, 12601, "Birch Leaves", "LEAVES"), BIRCH_LOG(17, 2, 26727, "Birch Log", "LOG"), BIRCH_PLANKS(5, 2, 29322, "Birch Wood Plank", "Birch Planks"), - BIRCH_PRESSURE_PLATE(-1, -1, 9664, "Birch Pressure Plate"), + BIRCH_PRESSURE_PLATE(null, null, 9664, "Birch Pressure Plate"), BIRCH_SAPLING(6, 2, 31533, "Birch Sapling"), - BIRCH_SIGN(-1, -1, 48790, "Birch Sign"), BIRCH_SLAB(126, 2, 13807, "Birch Slab"), BIRCH_STAIRS(135, 0, 7657, "Birch Wood Stairs", "Birch Stairs"), - BIRCH_TRAPDOOR(-1, -1, 32585, "Birch Trapdoor"), - BIRCH_WALL_SIGN(-1, -1, 5548, "Birch Wall Sign"), - BIRCH_WOOD(-1, -1, 20913, "Birch Wood"), - BIRCH_WOOD_BARK(-1, -1, 18354, "Birch Wood With Bark"), + BIRCH_TRAPDOOR(null, null, 32585, "Birch Trapdoor"), + BIRCH_WOOD(null, null, 20913, "Birch Wood"), BLACK_BANNER(425, 0, 9365, "Banner", "Black Banner"), BLACK_BED(355, 15, 20490, "Black Bed"), - BLACK_CARPET(171, 15, 6056, "Black Carpet"), + 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_DYE(-1, -1, 26753, "Black Dye"), BLACK_GLAZED_TERRACOTTA(250, 0, 29678, "Black Glazed Terracotta"), BLACK_SHULKER_BOX(234, 0, 24076, "Black Shulker Box"), - BLACK_STAINED_GLASS(95, 15, 13941, "Black Stained Glass"), - BLACK_STAINED_GLASS_PANE(160, 15, 13201, "Black Stained Glass Pane"), - BLACK_TERRACOTTA(159, 15, 26691, "Black Terracotta"), + 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(177, 0, 4919, "Black Banner"), BLACK_WOOL(35, 15, 16693, "Black Wool"), - BLAST_FURNACE(-1, -1, 8789, "Blast Furnace"), BLAZE_POWDER(377, 0, 18941, "Blaze Powder"), BLAZE_ROD(369, 0, 8289, "Blaze Rod"), BLAZE_SPAWN_EGG(383, 61, 4759, "Spawn Blaze", "Blaze Spawn Egg"), - BLUE_BANNER(245, 4, 18481, "Blue Banner"), + BLUE_BANNER(245, 4, 18481, "Blue Banner", "PURPLE_GLAZED_TERRACOTTA"), BLUE_BED(355, 11, 12714, "Blue Bed"), BLUE_CARPET(171, 11, 13292, "Blue Carpet"), BLUE_CONCRETE(251, 11, 18756, "Blue Concrete"), BLUE_CONCRETE_POWDER(252, 11, 17773, "Blue Concrete Powder"), - BLUE_DYE(-1, -1, 12344, "Blue Dye"), BLUE_GLAZED_TERRACOTTA(246, 0, 23823, "Blue Glazed Terracotta"), - BLUE_ICE(-1, -1, 22449, "Blue Ice"), + BLUE_ICE(null, null, 22449, "Blue Ice"), BLUE_ORCHID(38, 1, 13432, "Blue Orchid"), BLUE_SHULKER_BOX(230, 0, 11476, "Blue Shulker Box"), BLUE_STAINED_GLASS(95, 11, 7107, "Blue Stained Glass"), @@ -901,23 +1079,21 @@ public class ItemManager { BOOKSHELF(47, 0, 10069, "Bookshelf"), BOW(261, 0, 8745, "Bow"), BOWL(281, 0, 32661, "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"), - BRAIN_CORAL_WALL_FAN(-1, -1, 22685, "Brain Coral Wall Fan"), + BRAIN_CORAL(null, null, 31316, "Brain Coral"), + BRAIN_CORAL_BLOCK(null, null, 30618, "Brain Coral Block"), + BRAIN_CORAL_FAN(null, null, 13849, "Brain Coral Fan"), + BRAIN_CORAL_WALL_FAN(null, null, 22685, "Brain Coral Wall Fan"), BREAD(297, 0, 32049, "Bread"), BREWING_STAND(379, 0, 14539, "Brewing Stand", "BREWING_STAND_ITEM"), BRICK(336, 0, 6820, "Brick", "claybrick"), BRICKS(45, 0, 14165, "Bricks"), BRICK_SLAB(44, 4, 26333, "Brick Slab", "STEP"), BRICK_STAIRS(108, 0, 21534, "Brick Stairs"), - BRICK_WALL(-1, -1, 42470, "Brick Wall"), BROWN_BANNER(425, 3, 11481, "Brown Banner"), BROWN_BED(355, 12, 25624, "Brown Bed"), BROWN_CARPET(171, 12, 23352, "Brown Carpet"), BROWN_CONCRETE(251, 12, 19006, "Brown Concrete"), BROWN_CONCRETE_POWDER(252, 12, 21485, "Brown Concrete Powder"), - BROWN_DYE(-1, -1, 4237, "Brown Dye"), BROWN_GLAZED_TERRACOTTA(247, 0, 5655, "Brown Glazed Terracotta"), BROWN_MUSHROOM(39, 0, 9665, "Brown Mushroom"), BROWN_MUSHROOM_BLOCK(99, 0, 6291, "Brown Mushroom Block", "HUGE_MUSHROOM_1"), @@ -927,30 +1103,27 @@ public class ItemManager { BROWN_TERRACOTTA(159, 12, 23664, "Brown Terracotta"), BROWN_WALL_BANNER(177, 3, 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"), - BUBBLE_CORAL_WALL_FAN(-1, -1, 20382, "Bubble Coral Wall Fan"), + BUBBLE_COLUMN(null, null, 13758, "Bubble Column"), + BUBBLE_CORAL(null, null, 12464, "Bubble Coral"), + BUBBLE_CORAL_BLOCK(null, null, 15437, "Bubble Coral Block"), + BUBBLE_CORAL_FAN(null, null, 10795, "Bubble Coral Fan"), + BUBBLE_CORAL_WALL_FAN(null, null, 20382, "Bubble Coral Wall Fan"), BUCKET(325, 0, 15215, "Bucket"), CACTUS(81, 0, 12191, "Cactus"), CACTUS_GREEN(351, 2, 17296, "Cactus Green"), CAKE(354, 0, 27048, "Cake"), - CAMPFIRE(-1, -1, 44880, "Campfire"), CARROT(391, 0, 22824, "Carrot", "Carrotitem"), CARROTS(141, 0, 17258, "Carrots"), CARROT_ON_A_STICK(398, 0, 27809, "Carrot on a Stick", "carrotstick"), - CARTOGRAPHY_TABLE(-1, -1, 22447, "Cartography Table"), - CARVED_PUMPKIN(-1, -1, 25833, "Carved Pumpkin"), - CAT_SPAWN_EGG(-1, -1, 99786, "Cat Spawn Egg"), + CARVED_PUMPKIN(null, null, 25833, "Carved Pumpkin"), CAULDRON(380, 0, 26531, "Cauldron", "CAULDRON_ITEM"), - CAVE_AIR(-1, -1, 17422, "Cave Air"), + CAVE_AIR(null, null, 17422, "Cave Air"), CAVE_SPIDER_SPAWN_EGG(383, 59, 23341, "Spawn Cave Spider", "Cave Spider Spawn Egg"), CHAINMAIL_BOOTS(305, 0, 17953, "Chainmail Boots"), CHAINMAIL_CHESTPLATE(303, 0, 23602, "Chainmail Chestplate"), CHAINMAIL_HELMET(302, 0, 26114, "Chainmail Helmet"), CHAINMAIL_LEGGINGS(304, 0, 19087, "Chainmail Leggings"), - CHAIN_COMMAND_BLOCK(-1, -1, 26798, "Chain Command Block"), + CHAIN_COMMAND_BLOCK(null, null, 26798, "Chain Command Block"), CHARCOAL(263, 1, 5390, "Charcoal"), CHEST(54, 0, 22969, "Chest"), CHEST_MINECART(342, 0, 4497, "Minecart with Chest", "Storageminecart"), @@ -959,33 +1132,33 @@ public class ItemManager { 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_SANDSTONE(24, 1, 31763, "Chiseled Sandstone"), CHISELED_STONE_BRICKS(98, 3, 9087, "Chiseled Stone Bricks", "SMOOTH_BRICK"), CHORUS_FLOWER(200, 0, 28542, "Chorus Flower"), CHORUS_FRUIT(432, 0, 7652, "Chorus Fruit"), CHORUS_PLANT(199, 0, 28243, "Chorus Plant"), CLAY(82, 0, 27880, "Clay", "Clay Block"), CLAY_BALL(337, 0, 24603, "Clay Ball"), - CLOCK(347, 0, 14980, "Clock", "WATCH"), + CLOCK(347, 0, 14980, "Clock", "watch"), COAL(263, 0, 29067, "Coal"), COAL_BLOCK(173, 0, 27968, "Block of Coal"), COAL_ORE(16, 0, 30965, "Coal Ore"), COARSE_DIRT(3, 1, 15411, "Coarse Dirt"), - COBBLESTONE(4, 0, 32147, "Cobblestone", "COBBLE"), - COBBLESTONE_SLAB(44, 3, 6340, "Cobblestone Slab", "COBBLE_SLAB"), - COBBLESTONE_STAIRS(67, 0, 24715, "Cobblestone Stairs", "COBBLE_STAIRS"), + COBBLESTONE(4, 0, 32147, "Cobblestone"), + COBBLESTONE_SLAB(44, 3, 6340, "Cobblestone Slab"), + COBBLESTONE_STAIRS(67, 0, 24715, "Cobblestone Stairs"), COBBLESTONE_WALL(139, 0, 12616, "Cobblestone Wall", "COBBLE_WALL"), COBWEB(30, 0, 9469, "Cobweb", "WEB"), COCOA(127, 0, 29709, "Cocoa"), COCOA_BEANS(351, 3, 27381, "Coco Beans"), - COD(-1, -1, 24691, "Raw Cod"), - COD_BUCKET(-1, -1, 28601, "Bucket of Cod"), - COD_SPAWN_EGG(-1, -1, 27248, "Cod Spawn Egg"), + COD(null, null, 24691, "Raw Cod"), + COD_BUCKET(null, null, 28601, "Bucket of Cod"), + COD_SPAWN_EGG(null, null, 27248, "Cod Spawn Egg"), COMMAND_BLOCK(137, 0, 4355, "Command Block", "COMMAND"), COMMAND_BLOCK_MINECART(422, 0, 7992, "Minecart with Command Block"), COMPARATOR(404, 0, 18911, "Redstone Comparator"), COMPASS(345, 0, 24139, "Compass"), - CONDUIT(-1, -1, 5148, "Conduit"), + CONDUIT(null, null, 5148, "Conduit"), COOKED_BEEF(364, 0, 21595, "Steak"), COOKED_CHICKEN(366, 0, 20780, "Cooked Chicken"), COOKED_COD(350, 0, 9681, "Cooked Fish"), @@ -994,19 +1167,14 @@ public class ItemManager { COOKED_RABBIT(412, 0, 4454, "Cooked Rabbit"), COOKED_SALMON(350, 1, 5615, "Cooked Salmon"), COOKIE(357, 0, 27431, "Cookie"), - CORNFLOWER(-1, -1, 11248, "Cornflower"), COW_SPAWN_EGG(383, 92, 14761, "Spawn Cow", "Cow Spawn Egg"), CRACKED_STONE_BRICKS(98, 2, 27869, "Cracked Stone Bricks"), CRAFTING_TABLE(58, 0, 20706, "Crafting Table", "WORKBENCH"), - CREEPER_BANNER_PATTERN(-1, -1, 96784, "Creeper Banner Pattern"), CREEPER_HEAD(397, 4, 29146, "Mob Head (Creeper)", "Creeper Head"), CREEPER_SPAWN_EGG(383, 50, 9653, "Spawn Creeper", "Creeper Spawn Egg"), CREEPER_WALL_HEAD(144, 4, 30123, "Creeper Wall Head"), - CROSSBOW(-1, -1, 43432, "Crossbow"), - CUT_RED_SANDSTONE(-1, -1, 26842, "Cut Red Sandstone"), - CUT_RED_SANDSTONE_SLAB(-1, -1, 55798, "Cut Red Sandstone Slab"), - CUT_SANDSTONE(-1, -1, 6118, "Cut Sandstone"), - CUT_SANDSTONE_SLAB(-1, -1, 2214, "Cut Sandstone Slab"), + CUT_RED_SANDSTONE(null, null, 26842, "Cut Red Sandstone"), + CUT_SANDSTONE(null, null, 6118, "Cut Sandstone"), CYAN_BANNER(425, 6, 9839, "Cyan Banner"), CYAN_BED(355, 9, 16746, "Cyan Bed"), CYAN_CARPET(171, 9, 31495, "Cyan Carpet"), @@ -1024,48 +1192,45 @@ public class ItemManager { DANDELION(37, 0, 30558, "Dandelion", "YELLOW_FLOWER"), DANDELION_YELLOW(351, 11, 21789, "Dandelion Yellow"), DARK_OAK_BOAT(448, 0, 28618, "Dark Oak Boat", "BOAT_DARK_OAK"), - DARK_OAK_BUTTON(-1, -1, 6214, "Dark Oak Button"), + DARK_OAK_BUTTON(null, null, 6214, "Dark Oak Button"), DARK_OAK_DOOR(431, 0, 10669, "Dark Oak Door", "DARK_OAK_DOOR_ITEM"), DARK_OAK_FENCE(191, 0, 21767, "Dark Oak Fence"), DARK_OAK_FENCE_GATE(186, 0, 10679, "Dark Oak Fence Gate"), DARK_OAK_LEAVES(161, 1, 22254, "Dark Oak Leaves"), DARK_OAK_LOG(162, 1, 14831, "Dark Oak Log"), DARK_OAK_PLANKS(5, 5, 20869, "Dark Oak Wood Plank", "Dark Oak Planks"), - DARK_OAK_PRESSURE_PLATE(-1, -1, 31375, "Dark Oak Pressure Plate"), + DARK_OAK_PRESSURE_PLATE(null, null, 31375, "Dark Oak Pressure Plate"), DARK_OAK_SAPLING(6, 5, 14933, "Dark Oak Sapling"), - DARK_OAK_SIGN(-1, -1, 26472, "Dark Oak Sign"), DARK_OAK_SLAB(126, 5, 28852, "Dark Oak Wood Slab", "Dark Oak Slab"), DARK_OAK_STAIRS(164, 0, 22921, "Dark Oak Stairs"), - DARK_OAK_TRAPDOOR(-1, -1, 10355, "Dark Oak Trapdoor"), - DARK_OAK_WALL_SIGN(-1, -1, 14897, "Dark Oak Wall Sign"), - DARK_OAK_WOOD(-1, -1, 16995, "Dark Oak Wood"), - DARK_OAK_WOOD_BARK(-1, -1, 7354, "Dark Oak Wood With Bark"), + DARK_OAK_TRAPDOOR(null, null, 10355, "Dark Oak Trapdoor"), + DARK_OAK_WOOD(null, null, 16995, "Dark Oak Wood"), DARK_PRISMARINE(168, 2, 19940, "Dark Prismarine"), - DARK_PRISMARINE_SLAB(-1, -1, 7577, "Dark Prismarine Slab"), - DARK_PRISMARINE_STAIRS(-1, -1, 26511, "Dark Prismarine Stairs"), + DARK_PRISMARINE_SLAB(null, null, 7577, "Dark Prismarine Slab"), + DARK_PRISMARINE_STAIRS(null, null, 26511, "Dark Prismarine Stairs"), DAYLIGHT_DETECTOR(151, 0, 8864, "Daylight Detector"), - DEAD_BRAIN_CORAL(-1, -1, 9116, "Dead Brain Coral"), - DEAD_BRAIN_CORAL_BLOCK(-1, -1, 12979, "Dead Brain Coral Block"), - 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(-1, -1, 30583, "Dead Bubble Coral"), - DEAD_BUBBLE_CORAL_BLOCK(-1, -1, 28220, "Dead Bubble Coral Block"), - 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_BRAIN_CORAL(null, null, 9116, "Dead Brain Coral"), + DEAD_BRAIN_CORAL_BLOCK(null, null, 12979, "Dead Brain Coral Block"), + DEAD_BRAIN_CORAL_FAN(null, null, 26150, "Dead Brain Coral Fan"), + DEAD_BRAIN_CORAL_WALL_FAN(null, null, 23718, "Dead Brain Coral Wall Fan"), + DEAD_BUBBLE_CORAL(null, null, 30583, "Dead Bubble Coral"), + DEAD_BUBBLE_CORAL_BLOCK(null, null, 28220, "Dead Bubble Coral Block"), + DEAD_BUBBLE_CORAL_FAN(null, null, 17322, "Dead Bubble Coral Fan"), + DEAD_BUBBLE_CORAL_WALL_FAN(null, null, 18453, "Dead Bubble Coral Wall Fan"), DEAD_BUSH(32, 0, 22888, "Dead Bush"), - DEAD_FIRE_CORAL(-1, -1, 8365, "Dead Fire Coral"), - DEAD_FIRE_CORAL_BLOCK(-1, -1, 5307, "Dead Fire Coral Block"), - 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(-1, -1, 5755, "Dead Horn Coral"), - DEAD_HORN_CORAL_BLOCK(-1, -1, 15103, "Dead Horn Coral Block"), - 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(-1, -1, 18028, "Dead Tube Coral"), - DEAD_TUBE_CORAL_BLOCK(-1, -1, 28350, "Dead Tube Coral Block"), - DEAD_TUBE_CORAL_FAN(-1, -1, 17628, "Dead Tube Coral Fan"), - DEAD_TUBE_CORAL_WALL_FAN(-1, -1, 5128, "Dead Tube Coral Wall Fan"), - DEBUG_STICK(-1, -1, 24562, "Debug Stick"), + DEAD_FIRE_CORAL(null, null, 8365, "Dead Fire Coral"), + DEAD_FIRE_CORAL_BLOCK(null, null, 5307, "Dead Fire Coral Block"), + DEAD_FIRE_CORAL_FAN(null, null, 27073, "Dead Fire Coral Fan"), + DEAD_FIRE_CORAL_WALL_FAN(null, null, 23375, "Dead Fire Coral Wall Fan"), + DEAD_HORN_CORAL(null, null, 5755, "Dead Horn Coral"), + DEAD_HORN_CORAL_BLOCK(null, null, 15103, "Dead Horn Coral Block"), + DEAD_HORN_CORAL_FAN(null, null, 11387, "Dead Horn Coral Fan"), + DEAD_HORN_CORAL_WALL_FAN(null, null, 27550, "Dead Horn Coral Wall Fan"), + DEAD_TUBE_CORAL(null, null, 18028, "Dead Tube Coral"), + DEAD_TUBE_CORAL_BLOCK(null, null, 28350, "Dead Tube Coral Block"), + DEAD_TUBE_CORAL_FAN(null, null, 17628, "Dead Tube Coral Fan"), + DEAD_TUBE_CORAL_WALL_FAN(null, null, 5128, "Dead Tube Coral Wall Fan"), + DEBUG_STICK(null, null, 24562, "Debug Stick"), DETECTOR_RAIL(28, 0, 13475, "Detector Rail"), DIAMOND(264, 0, 20865, "Diamond"), DIAMOND_AXE(279, 0, 27277, "Diamond Axe"), @@ -1081,22 +1246,18 @@ public class ItemManager { DIAMOND_SHOVEL(277, 0, 25415, "Diamond Shovel", "DIAMOND_SPADE"), DIAMOND_SWORD(276, 0, 27707, "Diamond Sword"), DIORITE(1, 3, 24688, "Diorite"), - DIORITE_SLAB(-1, -1, 22789, "Diorite Slab"), - DIORITE_STAIRS(-1, -1, 22784, "Diorite Stairs"), - DIORITE_WALL(-1, -1, 58794, "Diorite Wall"), DIRT(3, 0, 10580, "Dirt"), DISPENSER(23, 0, 20871, "Dispenser"), - DOLPHIN_SPAWN_EGG(-1, -1, 20787, "Dolphin Spawn Egg"), + DOLPHIN_SPAWN_EGG(null, null, 20787, "Dolphin Spawn Egg"), DONKEY_SPAWN_EGG(383, 31, 14513, "Spawn Donkey", "Donkey Spawn Egg"), DRAGON_BREATH(437, 0, 20154, "Dragon's Breath"), DRAGON_EGG(122, 0, 29946, "Dragon Egg"), DRAGON_HEAD(397, 5, 20084, "Dragon Head"), DRAGON_WALL_HEAD(144, 5, 19818, "Dragon Wall Head"), - DRIED_KELP(-1, -1, 21042, "Dried Kelp"), - DRIED_KELP_BLOCK(-1, -1, 12966, "Dried Kelp Block"), + DRIED_KELP(null, null, 21042, "Dried Kelp"), + DRIED_KELP_BLOCK(null, null, 12966, "Dried Kelp Block"), DROPPER(158, 0, 31273, "Dropper"), - DROWNED_SPAWN_EGG(-1, -1, 19368, "Drowned Spawn Egg"), - DOUBLE_TALL_GRASS(175, 2, 21560, "Double Tall Grass"), + DROWNED_SPAWN_EGG(null, null, 19368, "Drowned Spawn Egg"), EGG(344, 0, 21603, "Egg"), ELDER_GUARDIAN_SPAWN_EGG(383, 4, 11418, "Spawn Elder Guardian", "Elder Guardian Spawn Egg"), ELYTRA(443, 0, 23829, "Elytra"), @@ -1118,9 +1279,6 @@ public class ItemManager { END_ROD(198, 0, 24832, "End Rod"), END_STONE(121, 0, 29686, "End Stone", "ENDER_STONE"), END_STONE_BRICKS(206, 0, 20314, "End Stone Bricks", "END_BRICKS"), - END_STONE_BRICK_SLAB(-1, -1, 88763, "End Stone Brick Slab"), - END_STONE_BRICK_STAIRS(-1, -1, 31579, "End Stone Brick Stairs"), - END_STONE_BRICK_WALL(-1, -1, 2451, "End Stone Brick Wall"), EVOKER_SPAWN_EGG(383, 34, 21271, "Spawn Evoker", "Evoker Spawn Egg"), EXPERIENCE_BOTTLE(384, 0, 12858, "Bottle o' Enchanting", "expbottle"), FARMLAND(60, 0, 31166, "Farmland", "SOIL"), @@ -1132,17 +1290,14 @@ public class ItemManager { FIREWORK_ROCKET(401, 0, 23841, "Firework Rocket"), FIREWORK_STAR(402, 0, 12190, "Firework Star", "FIREWORK_CHARGE"), FIRE_CHARGE(385, 0, 4842, "Fire Charge", "Fireball"), - 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"), - FIRE_CORAL_WALL_FAN(-1, -1, 20100, "Fire Coral Wall Fan"), + FIRE_CORAL(null, null, 29151, "Fire Coral"), + FIRE_CORAL_BLOCK(null, null, 12119, "Fire Coral Block"), + FIRE_CORAL_FAN(null, null, 11112, "Fire Coral Fan"), + FIRE_CORAL_WALL_FAN(null, null, 20100, "Fire Coral Wall Fan"), FISHING_ROD(346, 0, 4167, "Fishing Rod"), - FLETCHING_TABLE(-1, -1, 45782, "Fletching Table"), FLINT(318, 0, 23596, "Flint"), FLINT_AND_STEEL(259, 0, 28620, "Flint and Steel"), - FLOWER_BANNER_PATTERN(-1, -1, 78641, "Flower Banned Pattern"), FLOWER_POT(390, 0, 30567, "Flower Pot", "FLOWER_POT_ITEM"), - FOX_SPAWN_EGG(-1, -1, 77894, "Fox Spawn Egg"), FROSTED_ICE(212, 0, 21814, "Frosted Ice"), FURNACE(61, 0, 8133, "Furnace"), FURNACE_MINECART(343, 0, 14196, "Minecart with Furnace", "POWERED_MINECART"), @@ -1152,7 +1307,6 @@ public class ItemManager { GLASS_BOTTLE(374, 0, 6116, "Glass Bottle"), GLASS_PANE(102, 0, 5709, "Glass Pane", "THIN_GLASS"), GLISTERING_MELON_SLICE(382, 0, 20158, "Glistering Melon", "speckledmelon"), - GLOBE_BANNER_PATTERN(-1, -1, 89456, "Globe Banner Pattern"), GLOWSTONE(89, 0, 32713, "Glowstone"), GLOWSTONE_DUST(348, 0, 6665, "Glowstone Dust"), GOLDEN_APPLE(322, 0, 27732, "Golden Apple", "Gold apple"), @@ -1172,9 +1326,6 @@ public class ItemManager { GOLD_NUGGET(371, 0, 28814, "Gold Nugget"), GOLD_ORE(14, 0, 32625, "Gold Ore"), GRANITE(1, 1, 21091, "Granite"), - GRANITE_SLAB(-1, -1, 15481, "Granite Slab"), - GRANITE_STAIRS(-1, -1, 78943, "Granite Stairs"), - GRANITE_WALL(-1, -1, 13214, "Granite Wall"), GRASS(31, 1, 6155, "Grass"), GRASS_BLOCK(2, 0, 28346, "Grass Block"), GRASS_PATH(208, 0, 8604, "Grass Path"), @@ -1197,7 +1348,6 @@ public class ItemManager { GREEN_CARPET(171, 13, 7780, "Green Carpet"), GREEN_CONCRETE(251, 13, 17949, "Green Concrete"), GREEN_CONCRETE_POWDER(252, 13, 6904, "Green Concrete Powder"), - GREEN_DYE(-1, -1, 32141, "Green Dye"), GREEN_GLAZED_TERRACOTTA(248, 0, 6958, "Green Glazed Terracotta"), GREEN_SHULKER_BOX(232, 0, 9377, "Green Shulker Box"), GREEN_STAINED_GLASS(95, 13, 22503, "Green Stained Glass"), @@ -1205,18 +1355,17 @@ public class ItemManager { GREEN_TERRACOTTA(159, 13, 4105, "Green Terracotta"), GREEN_WALL_BANNER(177, 2, 15046, "Green Banner"), GREEN_WOOL(35, 13, 25085, "Green Wool"), - GRINDSTONE(-1, -1, 98746, "Grindstone"), GUARDIAN_SPAWN_EGG(383, 68, 20113, "Spawn Guardian", "Guardian Spawn Egg"), GUNPOWDER(289, 0, 29974, "Gunpowder", "SULPHUR"), HAY_BLOCK(170, 0, 17461, "Hay Bale"), - HEART_OF_THE_SEA(-1, -1, 11807, "Heart of the Sea"), + HEART_OF_THE_SEA(null, null, 11807, "Heart of the Sea"), HEAVY_WEIGHTED_PRESSURE_PLATE(148, 0, 16970, "Heavy Weighted Pressure Plate", "IRON_PLATE"), HOPPER(154, 0, 31974, "Hopper"), HOPPER_MINECART(408, 0, 19024, "Minecart with 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"), - HORN_CORAL_WALL_FAN(-1, -1, 28883, "Horn Coral Wall Fan"), + HORN_CORAL(null, null, 19511, "Horn Coral"), + HORN_CORAL_BLOCK(null, null, 19958, "Horn Coral Block"), + HORN_CORAL_FAN(null, null, 13610, "Horn Coral Fan"), + HORN_CORAL_WALL_FAN(null, null, 28883, "Horn Coral Wall Fan"), HORSE_SPAWN_EGG(383, 100, 25981, "Spawn Horse", "Horse Spawn Egg"), HUSK_SPAWN_EGG(383, 23, 20178, "Spawn Husk", "Husk Spawn Egg"), ICE(79, 0, 30428, "Ice"), @@ -1246,30 +1395,25 @@ public class ItemManager { IRON_TRAPDOOR(167, 0, 17095, "Iron Trapdoor"), ITEM_FRAME(389, 0, 27318, "Item Frame"), JACK_O_LANTERN(91, 0, 31612, "Jack o'Lantern"), - JIGSAW(-1, -1, 241, "Jigsaw"), JUKEBOX(84, 0, 19264, "Jukebox"), JUNGLE_BOAT(446, 0, 4495, "Jungle Boat", "BOAT_JUNGLE"), - JUNGLE_BUTTON(-1, -1, 25317, "Jungle Button"), + JUNGLE_BUTTON(null, null, 25317, "Jungle Button"), JUNGLE_DOOR(429, 0, 28163, "Jungle Door", "JUNGLE_DOOR_ITEM"), JUNGLE_FENCE(190, 0, 14358, "Jungle Fence"), JUNGLE_FENCE_GATE(185, 0, 21360, "Jungle Fence Gate"), JUNGLE_LEAVES(18, 3, 5133, "Jungle Leaves"), JUNGLE_LOG(17, 3, 20721, "Jungle Log"), JUNGLE_PLANKS(5, 3, 26445, "Jungle Wood Plank", "Jungle Planks"), - JUNGLE_PRESSURE_PLATE(-1, -1, 11376, "Jungle Pressure Plate"), + JUNGLE_PRESSURE_PLATE(null, null, 11376, "Jungle Pressure Plate"), JUNGLE_SAPLING(6, 3, 17951, "Jungle Sapling"), - JUNGLE_SIGN(-1, -1, 1257, "Jungle Sign"), JUNGLE_SLAB(43, 0, 19117, "Double Stone Slab"), JUNGLE_STAIRS(136, 0, 20636, "Jungle Wood Stairs", "Jungle Stairs"), - JUNGLE_TRAPDOOR(-1, -1, 8626, "Jungle Trapdoor"), - JUNGLE_WALL_SIGN(-1, -1, 45786, "Jungle Wall Sign"), - JUNGLE_WOOD(-1, -1, 10341, "Jungle Wood"), - JUNGLE_WOOD_BARK(-1, -1, 458, "Jungle Wood With Bark"), - KELP(-1, -1, 21916, "Kelp"), - KELP_PLANT(-1, -1, 29697, "Kelp Plant"), + JUNGLE_TRAPDOOR(null, null, 8626, "Jungle Trapdoor"), + JUNGLE_WOOD(null, null, 10341, "Jungle Wood"), + KELP(null, null, 21916, "Kelp"), + KELP_PLANT(null, null, 29697, "Kelp Plant"), KNOWLEDGE_BOOK(453, 0, 12646, "Knowledge Book"), LADDER(65, 0, 23599, "Ladder"), - LANTERN(-1, -1, 45789, "Lantern"), LAPIS_BLOCK(22, 0, 14485, "Lapis Lazuli Block"), LAPIS_LAZULI(351, 4, 11075, "Lapis Lazuli"), LAPIS_ORE(21, 0, 22934, "Lapis Lazuli Ore"), @@ -1281,10 +1425,8 @@ public class ItemManager { LEATHER_BOOTS(301, 0, 15282, "Leather Boots"), LEATHER_CHESTPLATE(299, 0, 29275, "Leather Tunic"), LEATHER_HELMET(298, 0, 11624, "Leather Cap"), - LEATHER_HORSE_ARMOR(-1, -1, 99785, "Leather Horse Armor"), LEATHER_LEGGINGS(300, 0, 28210, "Leather Pants"), - LECTERN(-1, -1, 22354, "Lectern"), - LEVER(69, 0, 15319, "Lever", "LEVER"), + LEVER(69, 0, 15319, "Lever"), LIGHT_BLUE_BANNER(425, 12, 18060, "Light Blue Banner"), LIGHT_BLUE_BED(355, 3, 20957, "Light Blue Bed"), LIGHT_BLUE_CARPET(171, 3, 21194, "Light Blue Carpet"), @@ -1313,7 +1455,6 @@ public class ItemManager { 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_OF_THE_VALLEY(-1, -1, 78994, "Lily Of the Valley"), LILY_PAD(111, 0, 19271, "Lily Pad", "WATER_LILY"), LIME_BANNER(425, 10, 18887, "Lime Banner"), LIME_BED(355, 5, 27860, "Lime Bed"), @@ -1330,7 +1471,6 @@ public class ItemManager { LIME_WOOL(35, 5, 10443, "Lime Wool"), LINGERING_POTION(441, 0, 25857, "Lingering Potion"), LLAMA_SPAWN_EGG(383, 103, 23640, "Spawn Llama", "Llama Spawn Egg"), - LOOM(-1, -1, 16797, "Loom"), MAGENTA_BANNER(425, 13, 15591, "Magenta Banner"), MAGENTA_BED(355, 2, 20061, "Magenta Bed"), MAGENTA_CARPET(171, 2, 6180, "Magenta Carpet"), @@ -1354,16 +1494,13 @@ public class ItemManager { MELON_STEM(105, 0, 8247, "Melon Stem"), MILK_BUCKET(335, 0, 9680, "Milk Bucket"), MINECART(328, 0, 14352, "Minecart"), - MOJANG_BANNER_PATTERN(-1, -1, 334578, "Mojang Banner Pattern"), MOOSHROOM_SPAWN_EGG(383, 96, 22125, "Spawn Mushroom Cow", "Mooshroom Spawn Egg"), - MOSSY_COBBLESTONE(48, 0, 21900, "Mossy Cobblestone"), - MOSSY_COBBLESTONE_SLAB(-1, -1, 87864, "Mossy Cobblestone Slab"), - MOSSY_COBBLESTONE_STAIRS(-1, -1, 6641327, "Mossy Cobblestone Stairs"),//TODO FROM + 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(36, 0, 13831, "Piston Moving Piece"), MULE_SPAWN_EGG(383, 32, 11229, "Spawn Mule", "Mule Spawn Egg"), - MUSHROOM_STEM(-1, -1, 16543, "Mushroom Stem"), + MUSHROOM_STEM(null, null, 16543, "Mushroom Stem"), MUSHROOM_STEW(282, 0, 16336, "Mushroom Stew", "MUSHROOM_SOUP"), MUSIC_DISC_11(2266, 0, 27426, "11 Disc", "RECORD_11"), MUSIC_DISC_13(2256, 0, 16359, "13 Disc", "GOLD_RECORD"), @@ -1380,10 +1517,10 @@ public class ItemManager { MUTTON(423, 0, 4792, "Raw Mutton"), MYCELIUM(110, 0, 9913, "Mycelium", "MYCEL"), NAME_TAG(421, 0, 30731, "Name Tag"), - NAUTILUS_SHELL(-1, -1, 19989, "Nautilus Shell"), + NAUTILUS_SHELL(null, null, 19989, "Nautilus Shell"), NETHERRACK(87, 0, 23425, "Netherrack"), - NETHER_BRICK(112, 0, 27802, "Nether Brick"), - NETHER_BRICKS(405, 0, 19996, "Nether Bricks"), + NETHER_BRICK(405, 0, 19996, "Nether Brick"), + NETHER_BRICKS(112, 0, 27802, "Nether Bricks"), 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"), @@ -1392,22 +1529,21 @@ public class ItemManager { NETHER_STAR(399, 0, 12469, "Nether Star"), NETHER_WART(372, 0, 29227, "Nether Wart", "NETHER_STALK"), NETHER_WART_BLOCK(214, 0, 15486, "Nether Wart Block"), - NOTE_BLOCK(25, 0, 20979, "Note Block"), + NOTE_BLOCK(25, 0, 20979, "Note Block", "NOTE_BLOCK"), OAK_BOAT(333, 0, 17570, "Boat", "Oak Boat"), - OAK_BUTTON(143, 0, 13510, "Oak Button", "wooden_button"), + OAK_BUTTON(143, 0, 13510, "Oak Button", "Wooden_button"), OAK_DOOR(324, 0, 20341, "Wooden Door", "Wood Door"), 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_PLANKS(5, 0, 14905, "Oak Wood Plank", "Oak Planks"), - OAK_PRESSURE_PLATE(72, 0, 20108, "Oak Pressure Plate", "Wooden_Pressure_Plate"), + OAK_PRESSURE_PLATE(72, 0, 20108, "Oak Pressure Plate", "Wooden_Presure_Plate"), OAK_SAPLING(6, 0, 9636, "Oak Sapling"), 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(-1, -1, 7378, "Oak Wood"), - OAK_WOOD_BARK(-1, -1, 2894, "Oak Wood With Bark"), + OAK_WOOD(null, null, 7378, "Oak Wood"), OBSERVER(218, 0, 10726, "Observer"), OBSIDIAN(49, 0, 32723, "Obsidian"), OCELOT_SPAWN_EGG(383, 98, 30080, "Spawn Ocelot", "Ocelot Spawn Egg"), @@ -1431,9 +1567,9 @@ public class ItemManager { PAPER(339, 0, 9923, "Paper"), PARROT_SPAWN_EGG(383, 105, 23614, "Spawn Parrot", "Parrot Spawn Egg"), 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"), + PETRIFIED_OAK_SLAB(null, null, 18658, "Petrified Oak Slab"), + PHANTOM_MEMBRANE(null, null, 18398, "Phantom Membrane"), + PHANTOM_SPAWN_EGG(null, null, 24648, "Phantom Spawn Egg"), PIG_SPAWN_EGG(383, 90, 22584, "Spawn Pig", "Pig Spawn Egg"), PINK_BANNER(425, 9, 19439, "Pink Banner"), PINK_BED(355, 6, 13795, "Pink Bed"), @@ -1464,46 +1600,46 @@ public class ItemManager { PORKCHOP(319, 0, 30896, "Raw Porkchop"), POTATO(392, 0, 21088, "Potato", "Potatoitem"), POTATOES(142, 0, 10879, "Potatoes"), - 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"), - POTION(373, 0, 45867, "Potion"), + POTION(373, 0, 24020, "Potion"), + POTTED_ACACIA_SAPLING(null, null, 14096, "Potted Acacia Sapling"), + POTTED_ALLIUM(null, null, 13184, "Potted Allium"), + POTTED_AZURE_BLUET(null, null, 8754, "Potted Azure Bluet"), + POTTED_BIRCH_SAPLING(null, null, 32484, "Potted Birch Sapling"), + POTTED_BLUE_ORCHID(null, null, 6599, "Potted Blue Orchid"), + POTTED_BROWN_MUSHROOM(null, null, 14481, "Potted Brown Mushroom"), + POTTED_CACTUS(null, null, 8777, "Potted Cactus"), + POTTED_DANDELION(null, null, 9727, "Potted Dandelion"), + POTTED_DARK_OAK_SAPLING(null, null, 6486, "Potted Dark Oak Sapling"), + POTTED_DEAD_BUSH(null, null, 13020, "Potted Dead Bush"), + POTTED_FERN(null, null, 23315, "Potted Fern"), + POTTED_JUNGLE_SAPLING(null, null, 7525, "Potted Jungle Sapling"), + POTTED_OAK_SAPLING(null, null, 11905, "Potted Oak Sapling"), + POTTED_ORANGE_TULIP(null, null, 28807, "Potted Orange Tulip"), + POTTED_OXEYE_DAISY(null, null, 19707, "Potted Oxeye Daisy"), + POTTED_PINK_TULIP(null, null, 10089, "Potted Pink Tulip"), + POTTED_POPPY(null, null, 7457, "Potted Poppy"), + POTTED_RED_MUSHROOM(null, null, 22881, "Potted Red Mushroom"), + POTTED_RED_TULIP(null, null, 28594, "Potted Red Tulip"), + POTTED_SPRUCE_SAPLING(null, null, 29498, "Potted Spruce Sapling"), + POTTED_WHITE_TULIP(null, null, 24330, "Potted White Tulip"), POWERED_RAIL(27, 0, 11064, "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_BRICK_SLAB(null, null, 26672, "Prismarine Brick Slab"), + PRISMARINE_BRICK_STAIRS(null, null, 15445, "Prismarine Brick Stairs"), PRISMARINE_CRYSTALS(410, 0, 31546, "Prismarine Crystals"), PRISMARINE_SHARD(409, 0, 10993, "Prismarine Shard"), - PRISMARINE_SLAB(-1, -1, 31323, "Prismarine Slab"), - PRISMARINE_STAIRS(-1, -1, 19217, "Prismarine Stairs"), + PRISMARINE_SLAB(null, null, 31323, "Prismarine Slab"), + PRISMARINE_STAIRS(null, null, 19217, "Prismarine Stairs"), PUFFERFISH(349, 3, 8115, "Pufferfish"), - PUFFERFISH_BUCKET(-1, -1, 8861, "Bucket of Pufferfish"), - PUFFERFISH_SPAWN_EGG(-1, -1, 24573, "Pufferfish Spawn Egg"), + PUFFERFISH_BUCKET(null, null, 8861, "Bucket of Pufferfish"), + PUFFERFISH_SPAWN_EGG(null, null, 24573, "Pufferfish Spawn Egg"), PUMPKIN(86, 0, 19170, "Pumpkin"), PUMPKIN_PIE(400, 0, 28725, "Pumpkin Pie"), PUMPKIN_SEEDS(361, 0, 28985, "Pumpkin Seeds"), PUMPKIN_STEM(104, 0, 19021, "Pumpkin Stem"), PURPLE_BANNER(425, 5, 29027, "Purple Banner"), - PURPLE_BED(355, 10, 29755, "Purple Bed"), + PURPLE_BED(355, 10, 29755, "Purple Bed", "Purple Bed"), PURPLE_CARPET(171, 10, 5574, "Purple Carpet"), PURPLE_CONCRETE(251, 10, 20623, "Purple Concrete"), PURPLE_CONCRETE_POWDER(252, 10, 26808, "Purple Concrete Powder"), @@ -1538,7 +1674,7 @@ public class ItemManager { REDSTONE_WALL_TORCH(76, 0, 7595, "Redstone Wall Torch"), REDSTONE_WIRE(55, 0, 25984, "Redstone Dust"), RED_BANNER(425, 1, 26961, "Red Banner"), - RED_BED(355, 14, 30910, "Red Bed"), + RED_BED(355, 14, 30910, "Red Bed", "Red Bed"), RED_CARPET(171, 14, 5424, "Red Carpet"), RED_CONCRETE(251, 14, 8032, "Red Concrete"), RED_CONCRETE_POWDER(252, 14, 13286, "Red Concrete Powder"), @@ -1546,7 +1682,7 @@ public class ItemManager { RED_MUSHROOM(40, 0, 19728, "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_SAND(12, 1, 16279, "Red 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"), @@ -1557,23 +1693,23 @@ public class ItemManager { RED_TULIP(38, 4, 16781, "Red Tulip"), RED_WALL_BANNER(177, 1, 4378, "Red Banner"), RED_WOOL(35, 14, 11621, "Red Wool"), - REPEATER(356, 0, 28823, "Redstone Repeater"), - REPEATING_COMMAND_BLOCK(-1, -1, 12405, "Repeating Command Block"), + REPEATER(356, 0, 28823, "Redstone Repeater", "Diode"), + REPEATING_COMMAND_BLOCK(null, null, 12405, "Repeating Command Block"), ROSE_BUSH(175, 4, 6080, "Rose Bush"), ROSE_RED(351, 1, 15694, "Rose Red"), ROTTEN_FLESH(367, 0, 21591, "Rotten Flesh"), SADDLE(329, 0, 30206, "Saddle"), SALMON(349, 1, 18516, "Raw Salmon"), - SALMON_BUCKET(-1, -1, 31427, "Bucket of Salmon"), - SALMON_SPAWN_EGG(-1, -1, 18739, "Salmon Spawn Egg"), + SALMON_BUCKET(null, null, 31427, "Bucket of Salmon"), + SALMON_SPAWN_EGG(null, null, 18739, "Salmon Spawn Egg"), SAND(12, 0, 11542, "Sand"), SANDSTONE(24, 0, 13141, "Sandstone"), SANDSTONE_SLAB(44, 1, 29830, "Sandstone Slab"), SANDSTONE_STAIRS(128, 0, 18474, "Sandstone Stairs"), - SCUTE(-1, -1, 11914, "Scute"), - SEAGRASS(-1, -1, 23942, "Seagrass"), + SCUTE(null, null, 11914, "Scute"), + SEAGRASS(null, null, 23942, "Seagrass"), SEA_LANTERN(169, 0, 16984, "Sea Lantern"), - SEA_PICKLE(-1, -1, 19562, "Sea Pickle"), + SEA_PICKLE(null, null, 19562, "Sea Pickle"), SHEARS(359, 0, 27971, "Shears"), SHEEP_SPAWN_EGG(383, 91, 24488, "Spawn Sheep", "Sheep Spawn Egg"), SHIELD(442, 0, 29943, "Shield"), @@ -1589,10 +1725,10 @@ public class ItemManager { SLIME_BALL(341, 0, 5242, "Slimeball"), SLIME_BLOCK(165, 0, 31892, "Slime Block"), SLIME_SPAWN_EGG(383, 55, 6550, "Spawn Slime", "Slime Spawn Egg"), - SMOOTH_QUARTZ(-1, -1, 14415, "Smooth Quartz"), + SMOOTH_QUARTZ(null, null, 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"), + SMOOTH_STONE(null, null, 21910, "Smooth Stone"), SNOW(78, 0, 14146, "Snow"), SNOWBALL(332, 0, 19487, "Snowball"), SNOW_BLOCK(80, 0, 19913, "Snow Block"), @@ -1602,22 +1738,21 @@ public class ItemManager { SPIDER_EYE(375, 0, 9318, "Spider Eye"), SPIDER_SPAWN_EGG(383, 52, 14984, "Spawn Spider", "Spider Spawn Egg"), SPLASH_POTION(438, 0, 30248, "Splash Potion"), - SPONGE(19, 0, 15860, "Sponge"), + SPONGE(19, 0, 15860, "Sponge", "SPONGE"), SPRUCE_BOAT(444, 0, 9606, "Spruce Boat", "BOAT_SPRUCE"), - SPRUCE_BUTTON(-1, -1, 23281, "Spruce Button"), + SPRUCE_BUTTON(null, null, 23281, "Spruce Button"), SPRUCE_DOOR(427, 0, 10642, "Spruce Door", "SPRUCE_DOOR_ITEM"), SPRUCE_FENCE(188, 0, 25416, "Spruce Fence"), SPRUCE_FENCE_GATE(183, 0, 26423, "Spruce Fence Gate"), SPRUCE_LEAVES(18, 1, 20039, "Spruce Leaves"), SPRUCE_LOG(17, 1, 9726, "Spruce Log"), SPRUCE_PLANKS(5, 1, 14593, "Spruce Wood Plank", "Spruce Planks"), - SPRUCE_PRESSURE_PLATE(-1, -1, 15932, "Spruce Pressure Plate"), + SPRUCE_PRESSURE_PLATE(null, null, 15932, "Spruce Pressure Plate"), SPRUCE_SAPLING(6, 1, 19874, "Spruce Sapling"), SPRUCE_SLAB(126, 1, 4348, "Spruce Slab"), SPRUCE_STAIRS(134, 0, 11192, "Spruce Wood Stairs", "Spruce Stairs"), - SPRUCE_TRAPDOOR(-1, -1, 10289, "Spruce Trapdoor"), - SPRUCE_WOOD(-1, -1, 32328, "Spruce Wood"), - SPRUCE_WOOD_BARK(-1, -1, 22156, "Spruce Wood With Bark"), + SPRUCE_TRAPDOOR(null, null, 10289, "Spruce Trapdoor"), + SPRUCE_WOOD(null, null, 32328, "Spruce Wood"), SQUID_SPAWN_EGG(383, 94, 10682, "Spawn Squid", "Squid Spawn Egg"), STICK(280, 0, 9773, "Stick"), STICKY_PISTON(29, 0, 18127, "Sticky Piston", "PISTON_STICKY_BASE"), @@ -1635,27 +1770,25 @@ public class ItemManager { STONE_SWORD(272, 0, 25084, "Stone Sword"), STRAY_SPAWN_EGG(383, 6, 30153, "Spawn Stray", "Stray Spawn Egg"), STRING(287, 0, 12806, "String"), - STRIPPED_ACACIA_LOG(-1, -1, 18167, "Stripped Acacia Log"), - STRIPPED_ACACIA_WOOD(-1, -1, 27193, "Stripped Acacia Wood"), - STRIPPED_BIRCH_LOG(-1, -1, 8838, "Stripped Birch Log"), - STRIPPED_BIRCH_WOOD(-1, -1, 22350, "Stripped Birch Wood"), - STRIPPED_DARK_OAK_LOG(-1, -1, 6492, "Stripped Dark Oak Log"), - STRIPPED_DARK_OAK_WOOD(-1, -1, 16000, "Stripped Dark Oak Wood"), - STRIPPED_JUNGLE_LOG(-1, -1, 15476, "Stripped Jungle Log"), - STRIPPED_JUNGLE_WOOD(-1, -1, 30315, "Stripped Jungle Wood"), - STRIPPED_OAK_LOG(-1, -1, 20523, "Stripped Oak Log"), - STRIPPED_OAK_WOOD(-1, -1, 31455, "Stripped Oak Wood"), - STRIPPED_SPRUCE_LOG(-1, -1, 6140, "Stripped Spruce Log"), - STRIPPED_SPRUCE_WOOD(-1, -1, 6467, "Stripped Spruce Wood"), + STRIPPED_ACACIA_LOG(null, null, 18167, "Stripped Acacia Log"), + STRIPPED_ACACIA_WOOD(null, null, 27193, "Stripped Acacia Wood"), + STRIPPED_BIRCH_LOG(null, null, 8838, "Stripped Birch Log"), + STRIPPED_BIRCH_WOOD(null, null, 22350, "Stripped Birch Wood"), + STRIPPED_DARK_OAK_LOG(null, null, 6492, "Stripped Dark Oak Log"), + STRIPPED_DARK_OAK_WOOD(null, null, 16000, "Stripped Dark Oak Wood"), + STRIPPED_JUNGLE_LOG(null, null, 15476, "Stripped Jungle Log"), + STRIPPED_JUNGLE_WOOD(null, null, 30315, "Stripped Jungle Wood"), + STRIPPED_OAK_LOG(null, null, 20523, "Stripped Oak Log"), + STRIPPED_OAK_WOOD(null, null, 31455, "Stripped Oak Wood"), + STRIPPED_SPRUCE_LOG(null, null, 6140, "Stripped Spruce Log"), + STRIPPED_SPRUCE_WOOD(null, null, 6467, "Stripped Spruce Wood"), STRUCTURE_BLOCK(255, 0, 26831, "Structure Block"), STRUCTURE_VOID(217, 0, 30806, "Structure Void"), SUGAR(353, 0, 30638, "Sugar"), SUGAR_CANE(338, 0, 7726, "Sugar Canes", "Sugar Cane"), SUNFLOWER(175, 0, 7408, "Sunflower"), - SUSPICIOUS_STEW(-1, -1, 7245, "Suspicious Stew"), - SWEET_BERRIES(-1, -1, 9451, "Sweet Berries"), - TALL_GRASS(31, 1, 21559, "Tall Grass"), - TALL_SEAGRASS(-1, -1, 27189, "Tall Seagrass"), + TALL_GRASS(31, 0, 21559, "Tall Grass"), + TALL_SEAGRASS(null, null, 27189, "Tall Seagrass"), TERRACOTTA(172, 0, 16544, "Terracotta", "HARD_CLAY"), TIPPED_ARROW(440, 0, 25164, "Tipped Arrow"), TNT(46, 0, 7896, "TNT"), @@ -1663,27 +1796,27 @@ public class ItemManager { TORCH(50, 0, 6063, "Torch"), TOTEM_OF_UNDYING(449, 0, 10139, "Totem Of Undying"), TRAPPED_CHEST(146, 0, 18970, "Trapped Chest"), - TRIDENT(455, 0, 7534, "Trident"), + TRIDENT(null, null, 7534, "Trident"), TRIPWIRE(132, 0, 8810, "Tripwire"), TRIPWIRE_HOOK(131, 0, 8130, "Tripwire Hook"), TROPICAL_FISH(349, 2, 24879, "Tropical Fish"), - TROPICAL_FISH_BUCKET(-1, -1, 29995, "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"), - TUBE_CORAL_WALL_FAN(-1, -1, 25282, "Tube Coral Wall Fan"), - TURTLE_EGG(-1, -1, 32101, "Turtle Egg"), - TURTLE_HELMET(-1, -1, 30120, "Turtle Shell"), - TURTLE_SPAWN_EGG(-1, -1, 17324, "Turtle Spawn Egg"), + TROPICAL_FISH_BUCKET(null, null, 29995, "Bucket of Tropical Fish"), + TROPICAL_FISH_SPAWN_EGG(null, null, 19713, "Tropical Fish Spawn Egg"), + TUBE_CORAL(null, null, 23048, "Tube Coral"), + TUBE_CORAL_BLOCK(null, null, 23723, "Tube Coral Block"), + TUBE_CORAL_FAN(null, null, 19929, "Tube Coral Fan"), + TUBE_CORAL_WALL_FAN(null, null, 25282, "Tube Coral Wall Fan"), + TURTLE_EGG(null, null, 32101, "Turtle Egg"), + TURTLE_HELMET(null, null, 30120, "Turtle Shell"), + TURTLE_SPAWN_EGG(null, null, 17324, "Turtle Spawn Egg"), VEX_SPAWN_EGG(383, 35, 27751, "Spawn Vex", "Vex Spawn Egg"), VILLAGER_SPAWN_EGG(383, 120, 30348, "Spawn Villager", "Villager Spawn Egg"), VINDICATOR_SPAWN_EGG(383, 36, 25324, "Spawn Vindicator", "Vindicator Spawn Egg"), VINE(106, 0, 14564, "Vines"), - VOID_AIR(-1, -1, 13668, "Void Air"), + VOID_AIR(null, null, 13668, "Void Air"), WALL_SIGN(68, 0, 10644, "Wall Sign"), WALL_TORCH(50, 0, 25890, "Wall Torch"), - WATER(8, 0, 24998, "Flowing Water", "FLOWING_WATER"), + WATER(8, 0, 24998, "Flowing Water"), WATER_BUCKET(326, 0, 8802, "Water Bucket"), WET_SPONGE(19, 1, 9043, "Wet Sponge"), WHEAT(296, 0, 27709, "Wheat"), @@ -1693,15 +1826,14 @@ public class ItemManager { WHITE_CARPET(171, 0, 15117, "White Carpet"), WHITE_CONCRETE(251, 0, 6281, "White Concrete"), WHITE_CONCRETE_POWDER(252, 0, 10363, "White Concrete Powder"), - WHITE_DYE(-1, -1, 5276, "White Dye"), WHITE_GLAZED_TERRACOTTA(235, 0, 11326, "White Glazed Terracotta"), WHITE_SHULKER_BOX(219, 0, 31750, "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, 15, 15967, "White Banner"), - WHITE_WOOL(35, 0, 8624, "White Wool", "WOOL"), + WHITE_WALL_BANNER(177, 15, 15967, "White Banner"), + WHITE_WOOL(35, 0, 8624, "White Wool", "Wool"), WITCH_SPAWN_EGG(383, 66, 11837, "Spawn Witch", "Witch Spawn Egg"), WITHER_SKELETON_SKULL(397, 1, 31487, "Mob Head (Wither Skeleton)", "Wither Skeleton Skull"), WITHER_SKELETON_SPAWN_EGG(383, 5, 10073, "Spawn Wither Skeleton", "Wither Skeleton Spawn Egg"), @@ -1724,7 +1856,7 @@ public class ItemManager { 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, 11, 32004, "Yellow Banner"), + YELLOW_WALL_BANNER(177, 11, 32004, "Yellow Banner"), YELLOW_WOOL(35, 4, 29507, "Yellow Wool"), ZOMBIE_HEAD(397, 2, 9304, "Mob Head (Zombie)", "Zombie Head"), ZOMBIE_HORSE_SPAWN_EGG(383, 29, 4275, "Spawn Zombie Horse", "Zombie Horse Spawn Egg"), @@ -1733,58 +1865,164 @@ public class ItemManager { ZOMBIE_VILLAGER_SPAWN_EGG(383, 27, 10311, "Spawn Zombie Villager", "Zombie Villager Spawn Egg"), ZOMBIE_WALL_HEAD(144, 2, 16296, "Zombie Wall Head"), - // Legacy - LEGACY_STATIONARY_WATER(9, 0, -1, "Stationary Water"), - LEGACY_STATIONARY_LAVA(11, 0, -1, "Stationary Lava"), - LEGACY_BURNING_FURNACE(62, 0, -1, "Burning Furnace"), - LEGACY_NETHER_WARTS(115, 0, -1, "Nether Warts"), - LEGACY_IRON_DOOR_BLOCK(71, 0, -1, "Iron Door Block"), - LEGACY_GLOWING_REDSTONE_ORE(74, 0, -1, "Glowing Redstone Ore"), - LEGACY_SUGAR_CANE_BLOCK(83, 0, -1, "Sugar Cane Block"), - LEGACY_RAW_FISH(349, 0, -1, "Raw Fish"), - LEGACY_SKULL(144, 0, -1, "Skull"), - LEGACY_SIGN_POST(63, 0, -1, "Sign Post"), - LEGACY_BED_BLOCK(26, 0, -1, "Bed Block"), - LEGACY_REDSTONE_TORCH_OFF(75, 0, -1, "Redstone Torch Off"), - LEGACY_CAKE_BLOCK(92, 0, -1, "Cake Block"), - LEGACY_DIODE_BLOCK_OFF(93, 0, -1, "Diode Block Off"), - LEGACY_DIODE_BLOCK_ON(94, 0, -1, "Diode Block On"), - LEGACY_BREWING_STAND(117, 0, -1, "Brewing Stand"), -// LEGACY_CAULDRON(118, 0, -1, "LEGACY_CAULDRON", ""), -// LEGACY_REDSTONE_LAMP_ON(124, -1, -1, "LEGACY_REDSTONE_LAMP_ON", ""), -// LEGACY_WOOD_DOUBLE_STEP(125, -1, -1, "LEGACY_WOOD_DOUBLE_STEP", ""), -// LEGACY_FLOWER_POT(140, -1, -1, "LEGACY_FLOWER_POT", ""), - LEGACY_REDSTONE_COMPARATOR_OFF(149, 0, -1, "Redstone Comparator Off", ""), - LEGACY_REDSTONE_COMPARATOR_ON(150, 0, -1, "Redstone Comparator On", ""), -// LEGACY_STANDING_BANNER(176, -1, -1, "LEGACY_STANDING_BANNER", ""), -// LEGACY_WALL_BANNER(177, -1, -1, "LEGACY_WALL_BANNER", ""), -// LEGACY_DAYLIGHT_DETECTOR_INVERTED(178, -1, -1, "LEGACY_DAYLIGHT_DETECTOR_INVERTED", ""), -// LEGACY_DOUBLE_STONE_SLAB2(181, -1, -1, "LEGACY_DOUBLE_STONE_SLAB2", ""), - LEGACY_WOODEN_DOOR_BLOCK(64, 0, -1, "Wooden Door Block"), - LEGACY_SPRUCE_DOOR(193, 0, -1, "Spruce Door Block"), - LEGACY_BIRCH_DOOR(194, 0, -1, "Birch Door Block"), - LEGACY_JUNGLE_DOOR(195, 0, -1, "Jungle Door Block"), - LEGACY_ACACIA_DOOR(196, 0, -1, "Acacia Door Block"), - LEGACY_DARK_OAK_DOOR(197, 0, -1, "Dark Oak Door Block"), -// LEGACY_PURPUR_DOUBLE_SLAB(204, -1, -1, "LEGACY_PURPUR_DOUBLE_SLAB", ""), -// LEGACY_COMMAND_REPEATING(210, -1, -1, "LEGACY_COMMAND_REPEATING", ""), -// LEGACY_COMMAND_CHAIN(211, -1, -1, "LEGACY_COMMAND_CHAIN", ""), - LEGACY_WHEAT(59, 0, -1, "Wheat Block"); + //1.14 + ACACIA_SIGN(null, null, 29808, "Acacia Sign"), + ACACIA_WALL_SIGN(null, null, 20316, "Acacia Wall Sign"), + ANDESITE_SLAB(null, null, 32124, "Andesite Slab"), + ANDESITE_STAIRS(null, null, 17747, "Andesite Stairs"), + ANDESITE_WALL(null, null, 14938, "Andesite Wall"), + BAMBOO(null, null, 18728, "Bamboo"), + BAMBOO_SAPLING(null, null, 8478, "Bamboo Sapling"), + BARREL(null, null, 22396, "Barrel"), + BELL(null, null, 20000, "Bell"), + BIRCH_SIGN(null, null, 11351, "Birch Sign"), + BIRCH_WALL_SIGN(null, null, 9887, "Birch Wall Sign"), + BLACK_DYE(null, null, 6202, "Black Dye"), + BLAST_FURNACE(null, null, 31157, "Blast Furnace"), + BLUE_DYE(null, null, 11588, "Blue Dye"), + BRICK_WALL(null, null, 18995, "Brick Wall"), + BROWN_DYE(null, null, 7648, "Brown Dye"), + CAMPFIRE(null, null, 8488, "Campfire"), + CARTOGRAPHY_TABLE(null, null, 28529, "Cartography Table"), + CAT_SPAWN_EGG(null, null, 29583, "Cat Spawn Egg"), + CORNFLOWER(null, null, 15405, "Cornflower"), + CREEPER_BANNER_PATTERN(null, null, 15774, "Banner Pattern"), + CROSSBOW(null, null, 4340, "Crossbow"), + CUT_RED_SANDSTONE_SLAB(null, null, -11, "Cut Red Sandstone Slab"), + CUT_SANDSTONE_SLAB(null, null, -10, "Cut Sandstone Slab"), + DARK_OAK_SIGN(null, null, 15127, "Dark Oak Sign"), + DARK_OAK_WALL_SIGN(null, null, 9508, "Dark Oak Wall Sign"), + DIORITE_SLAB(null, null, 10715, "Diorite Slab"), + DIORITE_STAIRS(null, null, 13134, "Diorite Stairs"), + DIORITE_WALL(null, null, 17412, "Diorite Wall"), + END_STONE_BRICK_SLAB(null, null, 23239, "End Stone Brick Slab"), + END_STONE_BRICK_STAIRS(null, null, 28831, "End Stone Brick Stairs"), + END_STONE_BRICK_WALL(null, null, 27225, "End Stone Brick Wall"), + FLETCHING_TABLE(null, null, 30838, "Fletching Table"), + FLOWER_BANNER_PATTERN(null, null, 5762, "Banner Pattern"), + FOX_SPAWN_EGG(null, null, -1, "Fox Spawn Egg"), + GLOBE_BANNER_PATTERN(null, null, -99, "Banner Pattern"), + GRANITE_SLAB(null, null, 25898, "Granite Slab"), + GRANITE_STAIRS(null, null, 21840, "Granite Stairs"), + GRANITE_WALL(null, null, 23279, "Granite Wall"), + GREEN_DYE(null, null, 23215, "Green Dye"), + GRINDSTONE(null, null, 26260, "Grindstone"), + JIGSAW(null, null, 17398, "Jigsaw Block"), + JUNGLE_SIGN(null, null, 24717, "Jungle Sign"), + JUNGLE_WALL_SIGN(null, null, 29629, "Jungle Wall Sign"), + LANTERN(null, null, 5992, "Lantern"), + LEATHER_HORSE_ARMOR(null, null, -2, "Leather Horse Armor"), + LECTERN(null, null, 23490, "Lectern"), + LILY_OF_THE_VALLEY(null, null, 7185, "Lily of the Valley"), + LOOM(null, null, 14276, "Loom"), + MOJANG_BANNER_PATTERN(null, null, 11903, "Banner Pattern"), + MOSSY_COBBLESTONE_SLAB(null, null, 12139, "Mossy Cobblestone Slab"), + MOSSY_COBBLESTONE_STAIRS(null, null, 29210, "Mossy Cobblestone Stairs"), + MOSSY_STONE_BRICK_SLAB(null, null, 14002, "Mossy Stone Brick Slab"), + MOSSY_STONE_BRICK_STAIRS(null, null, 27578, "Mossy Stone Brick Stairs"), + MOSSY_STONE_BRICK_WALL(null, null, 18259, "Mossy Stone Brick Wall"), + NETHER_BRICK_WALL(null, null, 10398, "Nether Brick Wall"), + OAK_SIGN(null, null, 8192, "Oak Sign"), + OAK_WALL_SIGN(null, null, 12984, "Oak Wall Sign"), + PANDA_SPAWN_EGG(null, null, 23759, "Panda Spawn Egg"), + PILLAGER_SPAWN_EGG(null, null, 28659, "Pillager Spawn Egg"), + POLISHED_ANDESITE_STAIRS(null, null, 7573, "Polished Andesite Stairs"), + POLISHED_ANDESITE_SLAB(null, null, 0, "Polished Andesite Slab"), + POLISHED_DIORITE_SLAB(null, null, 18303, "Polished Diorite Slab"), + POLISHED_DIORITE_STAIRS(null, null, 4625, "Polished Diorite Stairs"), + POLISHED_GRANITE_SLAB(null, null, 4521, "Polished Granite Slab"), + POLISHED_GRANITE_STAIRS(null, null, 29588, "Polished Granite Stairs"), + POTTED_BAMBOO(null, null, 22542, "Air"), + POTTED_CORNFLOWER(null, null, 28917, "Air"), + POTTED_LILY_OF_THE_VALLEY(null, null, 9364, "Air"), + POTTED_WITHER_ROSE(null, null, 26876, "Air"), + PRISMARINE_WALL(null, null, 18184, "Prismarine Wall"), + RAVAGER_SPAWN_EGG(null, null, 31284, "Ravager Spawn Egg"), + RED_DYE(null, null, 5728, "Red Dye"), + RED_NETHER_BRICK_SLAB(null, null, 12462, "Red Nether Brick Slab"), + RED_NETHER_BRICK_STAIRS(null, null, 26374, "Red Nether Brick Stairs"), + RED_NETHER_BRICK_WALL(null, null, 4580, "Red Nether Brick Wall"), + RED_SANDSTONE_WALL(null, null, 4753, "Red Sandstone Wall"), + SANDSTONE_WALL(null, null, 18470, "Sandstone Wall"), + SCAFFOLDING(null, null, 15757, "Scaffolding"), + SKULL_BANNER_PATTERN(null, null, 7680, "Banner Pattern"), + SMITHING_TABLE(null, null, 9082, "Smithing Table"), + SMOKER(null, null, 24781, "Smoker"), + SMOOTH_QUARTZ_SLAB(null, null, 26543, "Smooth Quartz Slab"), + SMOOTH_QUARTZ_STAIRS(null, null, 19560, "Smooth Quartz Stairs"), + SMOOTH_RED_SANDSTONE_SLAB(null, null, 16304, "Smooth Red Sandstone Slab"), + SMOOTH_RED_SANDSTONE_STAIRS(null, null, 17561, "Smooth Red Sandstone Stairs"), + SMOOTH_SANDSTONE_SLAB(null, null, 9030, "Smooth Sandstone Slab"), + SMOOTH_SANDSTONE_STAIRS(null, null, 21183, "Smooth Sandstone Stairs"), + SMOOTH_STONE_SLAB(null, null, 24129, "Smooth Stone Slab"), + SPRUCE_SIGN(null, null, 21502, "Spruce Sign"), + SPRUCE_WALL_SIGN(null, null, 7352, "Air"), + STONECUTTER(null, null, 25170, "Stonecutter"), + STONE_BRICK_WALL(null, null, 29073, "Stone Brick Wall"), + STONE_STAIRS(null, null, 23784, "Stone Stairs"), + SUSPICIOUS_STEW(null, null, 8173, "Suspicious Stew"), + SWEET_BERRIES(null, null, 19747, "Sweet Berries"), + SWEET_BERRY_BUSH(null, null, 11958, "Air"), + TRADER_LLAMA_SPAWN_EGG(null, null, 13512, "Trader Llama Spawn Egg"), + WANDERING_TRADER_SPAWN_EGG(null, null, 12312, "Wandering Trader Spawn Egg"), + WHITE_DYE(null, null, 10758, "White Dye"), + WITHER_ROSE(null, null, 8619, "Wither Rose"), + YELLOW_DYE(null, null, 5952, "Yellow Dye"), + COMPOSTER(null, null, -4, "Composter"), - private int legacyId; - private int legacyData; - private int id; + // Legacy + LEGACY_STATIONARY_WATER(9, 0, null, "Stationary Water"), + LEGACY_STATIONARY_LAVA(11, 0, null, "Stationary Lava"), + LEGACY_BURNING_FURNACE(62, 0, null, "Burning Furnace"), + LEGACY_NETHER_WARTS(115, 0, null, "Nether Warts"), + LEGACY_IRON_DOOR_BLOCK(71, 0, null, "Iron Door Block"), + LEGACY_GLOWING_REDSTONE_ORE(74, 0, null, "Glowing Redstone Ore"), + LEGACY_SUGAR_CANE_BLOCK(83, 0, null, "Sugar Cane Block"), + LEGACY_RAW_FISH(349, 0, null, "Raw Fish"), + LEGACY_SKULL(144, 0, null, "Skull"), + LEGACY_SIGN_POST(63, 0, null, "Sign Post"), + LEGACY_BED_BLOCK(26, 0, null, "Bed Block"), + LEGACY_REDSTONE_TORCH_OFF(75, 0, null, "Redstone Torch Off"), + LEGACY_REDSTONE_TORCH_ON(76, 0, null, "Redstone Torch On"), + LEGACY_CAKE_BLOCK(92, 0, null, "Cake Block"), + LEGACY_DIODE_BLOCK_OFF(93, 0, null, "Diode Block Off"), + LEGACY_DIODE_BLOCK_ON(94, 0, null, "Diode Block On"), + LEGACY_BREWING_STAND(117, null, null, "Brewing Stand"), +// LEGACY_CAULDRON(118, 0, null, "LEGACY_CAULDRON", ""), +// LEGACY_REDSTONE_LAMP_ON(124, null, null, "LEGACY_REDSTONE_LAMP_ON", ""), +// LEGACY_WOOD_DOUBLE_STEP(125, null, null, "LEGACY_WOOD_DOUBLE_STEP", ""), +// LEGACY_FLOWER_POT(140, null, null, "LEGACY_FLOWER_POT", ""), + LEGACY_REDSTONE_COMPARATOR_OFF(149, 0, null, "Redstone Comparator Off", ""), + LEGACY_REDSTONE_COMPARATOR_ON(150, 0, null, "Redstone Comparator On", ""), +// LEGACY_STANDING_BANNER(176, null, null, "LEGACY_STANDING_BANNER", ""), +// LEGACY_WALL_BANNER(177, null, null, "LEGACY_WALL_BANNER", ""), +// LEGACY_DAYLIGHT_DETECTOR_INVERTED(178, null, null, "LEGACY_DAYLIGHT_DETECTOR_INVERTED", ""), +// LEGACY_DOUBLE_STONE_SLAB2(181, null, null, "LEGACY_DOUBLE_STONE_SLAB2", ""), + LEGACY_WOODEN_DOOR_BLOCK(64, 0, null, "Wooden Door Block"), + LEGACY_SPRUCE_DOOR(193, 0, null, "Spruce Door Block"), + LEGACY_BIRCH_DOOR(194, 0, null, "Birch Door Block"), + LEGACY_JUNGLE_DOOR(195, 0, null, "Jungle Door Block"), + LEGACY_ACACIA_DOOR(196, 0, null, "Acacia Door Block"), + LEGACY_DARK_OAK_DOOR(197, 0, null, "Dark Oak Door Block"), +// LEGACY_PURPUR_DOUBLE_SLAB(204, null, null, "LEGACY_PURPUR_DOUBLE_SLAB", ""), +// LEGACY_COMMAND_REPEATING(210, null, null, "LEGACY_COMMAND_REPEATING", ""), +// LEGACY_COMMAND_CHAIN(211, null, null, "LEGACY_COMMAND_CHAIN", ""), + LEGACY_WHEAT(59, 0, null, "Wheat Block"); + + private Integer legacyId; + private Integer legacyData; + private Integer id; private String name; private String legacyName; private String bukkitName; private String mojangName; Material mat; - CMIMaterial(int legacyId, int legacyData, int id, String name) { + CMIMaterial(Integer legacyId, Integer legacyData, Integer id, String name) { this(legacyId, legacyData, id, name, null); } - CMIMaterial(int legacyId, int legacyData, int id, String name, String legacyName) { + CMIMaterial(Integer legacyId, Integer legacyData, Integer id, String name, String legacyName) { this.legacyId = legacyId; this.legacyData = legacyData; this.id = id; @@ -1796,13 +2034,15 @@ public class ItemManager { return name; } - public int getLegacyId() { - return legacyId; + @Deprecated + public Integer getLegacyId() { + return this.legacyId == null ? 0 : this.legacyId; } - public int getId() { + @Deprecated + public Integer getId() { if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { - return id; + return this.id == null ? 0 : this.id; } return getLegacyId(); } @@ -1812,24 +2052,6 @@ public class ItemManager { } public void updateMaterial() { - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) { - 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 (Material.getMaterial(one.name()).name() != this.name()) - continue; - mat = one; - break; - } - } if (mat == null) { for (Material one : Material.class.getEnumConstants()) { if (!one.name().replace("LEGACY_", "").replace("_", "").equalsIgnoreCase(this.name().replace("_", ""))) @@ -1854,15 +2076,8 @@ public class ItemManager { break; } } - } - - public ItemStack newItemStack() { - return newItemStack(1); - } - - public ItemStack newItemStack(int amount) { - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) { - if (mat == null) { + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + if (mat == null && this.getId() != null) { for (Material one : Material.class.getEnumConstants()) { if (one.getId() != this.getId()) continue; @@ -1871,13 +2086,18 @@ public class ItemManager { } } } + } + + public ItemStack newItemStack() { + return newItemStack(1); + } + + public ItemStack newItemStack(int amount) { if (mat == null) { - for (Material one : Material.class.getEnumConstants()) { - if (Material.getMaterial(one.name()).name() != this.name()) - continue; - mat = one; - break; - } + updateMaterial(); + } + if (mat == null) { + return new ItemStack(Material.STONE); } if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { ItemStack stack = new ItemStack(mat == null ? Material.STONE : mat); @@ -1894,19 +2114,20 @@ public class ItemManager { if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { return 0; } - return (short) legacyData; + return getLegacyData(); } - public int getLegacyData() { - return legacyData; + @Deprecated + public short getLegacyData() { + return legacyData == null ? 0 : legacyData.shortValue(); } public static CMIMaterial getRandom(CMIMaterial mat) { - List ls = new ArrayList<>(); + List ls = new ArrayList(); for (CMIMaterial one : CMIMaterial.values()) { - if (one.getLegacyId() == -1) + if (one.getLegacyId() == null) continue; if (one.getLegacyId() != mat.getLegacyId()) continue; @@ -1937,7 +2158,7 @@ public class ItemManager { if (mat == null) return CMIMaterial.NONE; for (CMIMaterial one : CMIMaterial.values()) { - if (one.getLegacyId() == -1) + if (one.getLegacyId() == null) continue; if (one.getLegacyId() != mat.getLegacyId()) continue; @@ -1954,21 +2175,24 @@ public class ItemManager { Integer ids = null; Integer data = null; id = id.replace("_", "").replace(" ", "").replace("minecraft:", "").toLowerCase(); - try { - ids = Integer.parseInt(id); - } catch (Throwable e) { - if (id.contains(":")) { - try { - ids = Integer.parseInt(id.split(":")[0]); - data = Integer.parseInt(id.split(":")[1]); - return get(ids, data); - } catch (Throwable ex) { - } - try { - data = Integer.parseInt(id.split(":")[1]); - id = id.split(":")[0]; - } catch (Throwable t) { + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + try { + ids = Integer.parseInt(id); + } catch (Throwable e) { + if (id.contains(":")) { + try { + ids = Integer.parseInt(id.split(":")[0]); + data = Integer.parseInt(id.split(":")[1]); + return get(ids, data); + } catch (Throwable t) { + } + + try { + data = Integer.parseInt(id.split(":")[1]); + id = id.split(":")[0]; + } catch (Throwable t) { + } } } } @@ -2010,20 +2234,27 @@ public class ItemManager { return mat; } - if (ids != null) { - if (data == null) - mat = get(ids); - else - mat = get(ids, data); + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + 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; + + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + if (ids != null) { + for (CMIMaterial one : CMIMaterial.values()) { + if (data == null && one.getId() == ids) + return one; + if (data != null && one.getId() == ids && one.getLegacyData() == data) + return one; + } + } } id = id.replace("_", "").toLowerCase(); @@ -2039,40 +2270,30 @@ public class ItemManager { public static CMIMaterial get(Material mat) { if (mat == null) return CMIMaterial.NONE; - for (CMIMaterial one : CMIMaterial.values()) { - if (one.getMaterial() == null) - continue; - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) { + + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + for (CMIMaterial one : CMIMaterial.values()) { + if (one.getMaterial() == null) + continue; if (one.getMaterial().getId() == mat.getId()) { return one; } } - if (one.getMaterial().name() == mat.name()) { - return one; - } + } else { + CMIMaterial m = byRealMaterial.get(mat); + if (m != null) + return m; } return CMIMaterial.NONE; } - /** - * Gets the Material id - * - * @deprecated the id is cancelled from 1.14+ - * @param id of material - * @return CMIMaterial - */ - @Deprecated public static CMIMaterial get(int id) { for (CMIMaterial one : CMIMaterial.values()) { if (one.getMaterial() == null) continue; - if (Version.isCurrentEqualOrLower(Version.v1_13_R1)) { - if (one.getMaterial().getId() == id) { + if (one.getId() == id) { return one; } - } else { - return one; - } } for (CMIMaterial one : CMIMaterial.values()) { if (one.getLegacyId() == id) { @@ -2089,12 +2310,17 @@ public class ItemManager { // int tid = CMI.getInstance().getNMS().getEggId(item); // return get(item.getType().getId(), tid); // } - CMIMaterial m = Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? get(item.getType().getId()) : get(item.getType().getId(), item.getData().getData()); + CMIMaterial m = null; + if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + m = Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? get(item.getType().getId()) : get(item.getType().getId(), item.getData().getData()); - if (m == null) { - CMIItemStack cm = byBukkitName.get(item.getType().toString().toLowerCase().replace("_", "")); - if (cm != null) - m = cm.getCMIType(); + if (m == null) { + CMIItemStack cm = byBukkitName.get(item.getType().toString().toLowerCase().replace("_", "")); + if (cm != null) + m = cm.getCMIType(); + } + } else { + m = byRealMaterial.get(item.getType()); } return m == null ? CMIMaterial.NONE : m; @@ -2109,7 +2335,12 @@ public class ItemManager { data = (byte) skull.getSkullType().ordinal(); } - CMIMaterial m = get(block.getType().getId(), data); + CMIMaterial m = null; + + if (Version.isCurrentEqualOrHigher(Version.v1_14_R1)) { + m = byRealMaterial.get(block.getType()); + } + if (m == null) { CMIItemStack cm = byBukkitName.get(block.getType().toString().replace("_", "").toLowerCase()); if (cm != null) @@ -2120,17 +2351,18 @@ public class ItemManager { if (cm != null) m = cm.getCMIType(); } + if (m == null && Version.isCurrentEqualOrLower(Version.v1_13_R2)) { + m = get(block.getType().getId(), Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : data); + } return m == null ? CMIMaterial.NONE : m; } - @Deprecated 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(); @@ -2156,7 +2388,6 @@ public class ItemManager { return mat == null ? CMIMaterial.NONE : mat; } - @Deprecated public static CMIMaterial getLegacy(int id) { CMIItemStack cm = byId.get(id); if (cm != null) @@ -2177,6 +2408,10 @@ public class ItemManager { return this.getMaterial() == null ? false : this.getMaterial().isBlock(); } + public boolean isEquipment() { + return getMaxDurability() > 16; + } + public boolean isSolid() { return this.getMaterial() == null ? false : this.getMaterial().isSolid(); } @@ -2243,8 +2478,14 @@ public class ItemManager { case TROPICAL_FISH_SPAWN_EGG: case TURTLE_EGG: case TURTLE_SPAWN_EGG: + case CAT_SPAWN_EGG: case FOX_SPAWN_EGG: + case PANDA_SPAWN_EGG: + case PILLAGER_SPAWN_EGG: + case RAVAGER_SPAWN_EGG: + case TRADER_LLAMA_SPAWN_EGG: + case WANDERING_TRADER_SPAWN_EGG: return true; default: break; @@ -2294,17 +2535,12 @@ public class ItemManager { public boolean isStairs() { switch (this) { case ACACIA_STAIRS: - case ANDESITE_STAIRS: case BIRCH_STAIRS: case BRICK_STAIRS: case COBBLESTONE_STAIRS: case DARK_OAK_STAIRS: case DARK_PRISMARINE_STAIRS: - case DIORITE_STAIRS: - case END_STONE_BRICK_STAIRS: - case GRANITE_STAIRS: case JUNGLE_STAIRS: - case MOSSY_COBBLESTONE_STAIRS: case NETHER_BRICK_STAIRS: case OAK_STAIRS: case PRISMARINE_BRICK_STAIRS: @@ -2315,6 +2551,40 @@ public class ItemManager { case SANDSTONE_STAIRS: case SPRUCE_STAIRS: case STONE_BRICK_STAIRS: + + case ANDESITE_STAIRS: + case DIORITE_STAIRS: + case END_STONE_BRICK_STAIRS: + case GRANITE_STAIRS: + case MOSSY_COBBLESTONE_STAIRS: + case MOSSY_STONE_BRICK_STAIRS: + case POLISHED_ANDESITE_STAIRS: + case POLISHED_DIORITE_STAIRS: + case POLISHED_GRANITE_STAIRS: + case RED_NETHER_BRICK_STAIRS: + case SMOOTH_QUARTZ_STAIRS: + case SMOOTH_RED_SANDSTONE_STAIRS: + case SMOOTH_SANDSTONE_STAIRS: + case STONE_STAIRS: + return true; + default: + break; + } + return false; + } + + public static boolean isPotion(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isPotion(); + } + + public boolean isPotion() { + switch (this) { + case POTION: + case LINGERING_POTION: + case SPLASH_POTION: return true; default: break; @@ -2344,25 +2614,6 @@ public class ItemManager { return false; } - public static boolean isAnvil(Material mat) { - CMIMaterial m = CMIMaterial.get(mat); - if (m == null) - return false; - return m.isAnvil(); - } - - public boolean isAnvil() { - switch (this) { - case ANVIL: - case CHIPPED_ANVIL: - case DAMAGED_ANVIL: - return true; - default: - break; - } - return false; - } - public static boolean isSapling(Material mat) { CMIMaterial m = CMIMaterial.get(mat); if (m == null) @@ -2414,6 +2665,42 @@ public class ItemManager { return false; } + public static boolean isWater(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isWater(); + } + + public boolean isWater() { + switch (this) { + case WATER: + case LEGACY_STATIONARY_WATER: + return true; + default: + break; + } + return false; + } + + public static boolean isLava(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isLava(); + } + + public boolean isLava() { + switch (this) { + case LAVA: + case LEGACY_STATIONARY_LAVA: + return true; + default: + break; + } + return false; + } + public static boolean isPlate(Material mat) { CMIMaterial m = CMIMaterial.get(mat); if (m == null) @@ -2556,6 +2843,138 @@ public class ItemManager { return false; } + public static boolean isArmor(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isArmor(); + } + + public boolean isArmor() { + switch (this) { + case CHAINMAIL_HELMET: + case DIAMOND_HELMET: + case GOLDEN_HELMET: + case IRON_HELMET: + case LEATHER_HELMET: + case CHAINMAIL_CHESTPLATE: + case DIAMOND_CHESTPLATE: + case GOLDEN_CHESTPLATE: + case IRON_CHESTPLATE: + case LEATHER_CHESTPLATE: + case CHAINMAIL_LEGGINGS: + case DIAMOND_LEGGINGS: + case GOLDEN_LEGGINGS: + case IRON_LEGGINGS: + case LEATHER_LEGGINGS: + case CHAINMAIL_BOOTS: + case DIAMOND_BOOTS: + case GOLDEN_BOOTS: + case IRON_BOOTS: + case LEATHER_BOOTS: + case SHIELD: + case TURTLE_HELMET: + return true; + default: + break; + } + return false; + } + + public static boolean isWeapon(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isWeapon(); + } + + public boolean isWeapon() { + switch (this) { + case DIAMOND_SWORD: + case IRON_SWORD: + case GOLDEN_SWORD: + case STONE_SWORD: + case WOODEN_SWORD: + case BOW: + case CROSSBOW: + case TRIDENT: + return true; + default: + break; + } + return false; + } + + public static boolean isTool(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isTool(); + } + + public boolean isTool() { + switch (this) { + case DIAMOND_PICKAXE: + case GOLDEN_PICKAXE: + case IRON_PICKAXE: + case STONE_PICKAXE: + case WOODEN_PICKAXE: + case DIAMOND_SHOVEL: + case GOLDEN_SHOVEL: + case IRON_SHOVEL: + case STONE_SHOVEL: + case WOODEN_SHOVEL: + case DIAMOND_AXE: + case GOLDEN_AXE: + case IRON_AXE: + case STONE_AXE: + case WOODEN_AXE: + case SHEARS: + case FISHING_ROD: + return true; + default: + break; + } + return false; + } + + public static boolean isPotted(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isPotted(); + } + + public boolean isPotted() { + switch (this) { + case POTTED_ACACIA_SAPLING: + case POTTED_ALLIUM: + case POTTED_AZURE_BLUET: + case POTTED_BIRCH_SAPLING: + case POTTED_BLUE_ORCHID: + case POTTED_BROWN_MUSHROOM: + case POTTED_CACTUS: + case POTTED_DANDELION: + case POTTED_DARK_OAK_SAPLING: + case POTTED_DEAD_BUSH: + case POTTED_FERN: + case POTTED_JUNGLE_SAPLING: + case POTTED_OAK_SAPLING: + case POTTED_ORANGE_TULIP: + case POTTED_OXEYE_DAISY: + case POTTED_PINK_TULIP: + case POTTED_POPPY: + case POTTED_RED_MUSHROOM: + case POTTED_RED_TULIP: + case POTTED_SPRUCE_SAPLING: + case POTTED_WHITE_TULIP: + return true; + default: + break; + } + return false; + } + public static boolean isAir(Material mat) { CMIMaterial m = CMIMaterial.get(mat); if (m == null) @@ -2575,6 +2994,25 @@ public class ItemManager { return false; } + public static boolean isAnvil(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isAnvil(); + } + + public boolean isAnvil() { + switch (this) { + case ANVIL: + case CHIPPED_ANVIL: + case DAMAGED_ANVIL: + return true; + default: + break; + } + return false; + } + public static boolean isDoor(Material mat) { CMIMaterial m = CMIMaterial.get(mat); if (m == null) @@ -2586,15 +3024,24 @@ public class ItemManager { switch (this) { case OAK_DOOR: case IRON_DOOR: + case LEGACY_SPRUCE_DOOR: case LEGACY_BIRCH_DOOR: case LEGACY_JUNGLE_DOOR: case LEGACY_ACACIA_DOOR: case LEGACY_DARK_OAK_DOOR: case LEGACY_WOODEN_DOOR_BLOCK: + +// case SPRUCE_DOOR_ITEM: +// case BIRCH_DOOR_ITEM: +// case JUNGLE_DOOR_ITEM: +// case ACACIA_DOOR_ITEM: +// case DARK_OAK_DOOR_ITEM: +// case WOODEN_DOOR: case ACACIA_DOOR: case BIRCH_DOOR: case DARK_OAK_DOOR: +// case IRON_DOOR_BLOCK: case JUNGLE_DOOR: case SPRUCE_DOOR: return true; @@ -2650,6 +3097,26 @@ public class ItemManager { return false; } + public static boolean isRail(Material mat) { + CMIMaterial m = CMIMaterial.get(mat); + if (m == null) + return false; + return m.isRail(); + } + + public boolean isRail() { + switch (this) { + case POWERED_RAIL: + case RAIL: + case ACTIVATOR_RAIL: + case DETECTOR_RAIL: + return true; + default: + break; + } + return false; + } + public static boolean isGlassPane(Material mat) { CMIMaterial m = CMIMaterial.get(mat); if (m == null) @@ -2695,6 +3162,20 @@ public class ItemManager { case SIGN: case WALL_SIGN: case LEGACY_SIGN_POST: + + case ACACIA_SIGN: + case ACACIA_WALL_SIGN: + case BIRCH_SIGN: + case BIRCH_WALL_SIGN: + case DARK_OAK_SIGN: + case DARK_OAK_WALL_SIGN: + case JUNGLE_SIGN: + case JUNGLE_WALL_SIGN: + case OAK_SIGN: + case OAK_WALL_SIGN: + case SPRUCE_SIGN: + case SPRUCE_WALL_SIGN: + return true; default: break; @@ -2711,12 +3192,21 @@ public class ItemManager { public boolean isWall() { switch (this) { + case COBBLESTONE_WALL: + case MOSSY_COBBLESTONE_WALL: + case ANDESITE_WALL: case BRICK_WALL: - case COBBLESTONE_WALL: case DIORITE_WALL: + case END_STONE_BRICK_WALL: case GRANITE_WALL: - case MOSSY_COBBLESTONE_WALL: + case MOSSY_STONE_BRICK_WALL: + case NETHER_BRICK_WALL: + case PRISMARINE_WALL: + case RED_NETHER_BRICK_WALL: + case RED_SANDSTONE_WALL: + case SANDSTONE_WALL: + case STONE_BRICK_WALL: return true; default: break; @@ -2789,17 +3279,21 @@ public class ItemManager { case CYAN_DYE: case LIGHT_GRAY_DYE: case GRAY_DYE: - case BLACK_DYE: case PINK_DYE: - case BLUE_DYE: - case BROWN_DYE: case LIME_DYE: case DANDELION_YELLOW: case LIGHT_BLUE_DYE: case MAGENTA_DYE: case ORANGE_DYE: case BONE_MEAL: + + case BLACK_DYE: + case BLUE_DYE: + case BROWN_DYE: + case GREEN_DYE: + case RED_DYE: case WHITE_DYE: + case YELLOW_DYE: return true; default: break; @@ -2817,17 +3311,13 @@ public class ItemManager { public boolean isSlab() { switch (this) { case ACACIA_SLAB: - case ANDESITE_SLAB: case DARK_OAK_SLAB: // case DOUBLE_STONE_SLAB2: // case PURPUR_DOUBLE_SLAB: case BIRCH_SLAB: case BRICK_SLAB: case COBBLESTONE_SLAB: - case CUT_RED_SANDSTONE_SLAB: - case CUT_SANDSTONE_SLAB: case DARK_PRISMARINE_SLAB: - case DIORITE_SLAB: // case DOUBLE_STONE_SLAB: // case DOUBLE_SANDSTONE_SLAB: // case DOUBLE_WOODEN_SLAB: @@ -2836,10 +3326,7 @@ public class ItemManager { // case DOUBLE_STONE_BRICK_SLAB: // case DOUBLE_NETHER_BRICK_SLAB: // case DOUBLE_QUARTZ_SLAB: - case END_STONE_BRICK_SLAB: - case GRANITE_SLAB: case JUNGLE_SLAB: - case MOSSY_COBBLESTONE_SLAB: case NETHER_BRICK_SLAB: case OAK_SLAB: case PETRIFIED_OAK_SLAB: @@ -2852,6 +3339,23 @@ public class ItemManager { case SPRUCE_SLAB: case STONE_BRICK_SLAB: case STONE_SLAB: + + case ANDESITE_SLAB: + case CUT_RED_SANDSTONE_SLAB: + case CUT_SANDSTONE_SLAB: + case DIORITE_SLAB: + case END_STONE_BRICK_SLAB: + case GRANITE_SLAB: + case MOSSY_COBBLESTONE_SLAB: + case MOSSY_STONE_BRICK_SLAB: + case POLISHED_ANDESITE_SLAB: + case POLISHED_DIORITE_SLAB: + case POLISHED_GRANITE_SLAB: + case RED_NETHER_BRICK_SLAB: + case SMOOTH_QUARTZ_SLAB: + case SMOOTH_RED_SANDSTONE_SLAB: + case SMOOTH_SANDSTONE_SLAB: + case SMOOTH_STONE_SLAB: return true; default: break; @@ -2863,20 +3367,18 @@ public class ItemManager { if (!isSlab(block.getType())) return SlabType.NOTSLAB; - if (version.isEqualOrHigher(Version.v1_13_R1)) { - try { - if (block.getBlockData() instanceof org.bukkit.block.data.type.Slab) { - org.bukkit.block.data.type.Slab slab = (org.bukkit.block.data.type.Slab) block.getBlockData(); - org.bukkit.block.data.type.Slab.Type t = slab.getType(); - if (t.equals(org.bukkit.block.data.type.Slab.Type.TOP)) - return SlabType.TOP; - if (t.equals(org.bukkit.block.data.type.Slab.Type.BOTTOM)) - return SlabType.BOTTOM; - if (t.equals(org.bukkit.block.data.type.Slab.Type.DOUBLE)) - return SlabType.DOUBLE; - + if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) { + if (block.getBlockData() instanceof org.bukkit.block.data.type.Slab) { + org.bukkit.block.data.type.Slab slab = (org.bukkit.block.data.type.Slab) block.getBlockData(); + switch (slab.getType()) { + case TOP: + return SlabType.TOP; + case BOTTOM: + return SlabType.BOTTOM; + case DOUBLE: + return SlabType.DOUBLE; } - } catch (NoClassDefFoundError e) { + } return SlabType.NOTSLAB; } @@ -2964,10 +3466,4 @@ public class ItemManager { } } - public enum SlabType { - TOP, - BOTTOM, - DOUBLE, - NOTSLAB; - } } diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java index f71944f5..9e367657 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java @@ -82,53 +82,6 @@ public class ItemReflection { } } - public static String getItemRealName(ItemStack item) { - try { - Object nmsStack = asNMSCopy(item); - Method itemMeth = Item.getMethod("getById", int.class); - @SuppressWarnings("deprecation") - 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_12_R1: - 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 (Throwable e) { - return item != null ? item.getType().name() : ""; - } - } - public String getItemMinecraftNamePath(ItemStack item) { try { Object nmsStack = asNMSCopy(item); diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java b/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java index 60fd0972..f8f6ad51 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java @@ -22,7 +22,7 @@ public class VersionChecker { version = Version.getCurrent(); } - private static Version version = Version.v1_13_R2; + private static Version version = Version.v1_14_R1; public Version getVersion() { return Version.getCurrent(); @@ -151,25 +151,22 @@ public class VersionChecker { if (!Jobs.getGCManager().isShowNewVersion()) return; - Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { - @Override - public void run() { - String currentVersion = plugin.getDescription().getVersion(); - String newVersion = getNewVersion(); - if (newVersion == null || newVersion.equalsIgnoreCase(currentVersion)) - return; - List msg = Arrays.asList( - ChatColor.GREEN + "*********************** " + plugin.getDescription().getName() + " **************************", - ChatColor.GREEN + "* " + newVersion + " is now available! Your version: " + currentVersion, - ChatColor.GREEN + "* " + ChatColor.DARK_GREEN + plugin.getDescription().getWebsite(), - ChatColor.GREEN + "************************************************************"); - for (String one : msg) - if (player != null) - player.sendMessage(one); - else - Jobs.consoleMsg(one); - } - }); + Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + String currentVersion = plugin.getDescription().getVersion(); + String newVersion = getNewVersion(); + if (newVersion == null || newVersion.equalsIgnoreCase(currentVersion)) + return; + List msg = Arrays.asList( + ChatColor.GREEN + "*********************** " + plugin.getDescription().getName() + " **************************", + ChatColor.GREEN + "* " + newVersion + " is now available! Your version: " + currentVersion, + ChatColor.GREEN + "* " + ChatColor.DARK_GREEN + plugin.getDescription().getWebsite(), + ChatColor.GREEN + "************************************************************"); + for (String one : msg) + if (player != null) + player.sendMessage(one); + else + Jobs.consoleMsg(one); + }); } public String getNewVersion() { @@ -181,7 +178,7 @@ public class VersionChecker { String version = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine(); if (version.length() <= 7) return version; - } catch (Throwable ex) { + } catch (Throwable t) { Jobs.consoleMsg("&cFailed to check for " + plugin.getDescription().getName() + " update on spigot web page."); } return null; diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java index ef83adf9..ebb60e3f 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java @@ -26,8 +26,8 @@ public class RestrictedBlockManager { ConfigReader cfg = null; try { cfg = new ConfigReader("restrictedBlocks.yml"); - } catch (Throwable e1) { - e1.printStackTrace(); + } catch (Throwable t) { + t.printStackTrace(); } if (cfg == null) return; @@ -43,7 +43,7 @@ public class RestrictedBlockManager { for (String one : lss) { if (((cfg.getC().isString("blocksTimer." + one + ".id")) || (cfg.getC().isInt("blocksTimer." + one + ".id"))) && (cfg.getC().isInt("blocksTimer." + one + ".cd"))) { - CMIItemStack cm = ItemManager.getItem(cfg.getC().getString("blocksTimer." + one + ".id")); + CMIItemStack cm = ItemManager.getItem(CMIMaterial.get(cfg.getC().getString("blocksTimer." + one + ".id"))); if ((cm == null) || (!cm.getCMIType().isBlock())) { Jobs.consoleMsg("&e[Jobs] Your defined (" + one + ") protected block id/name is not correct!"); continue; diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 96deead3..33c58f95 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -484,12 +484,14 @@ public class JobsListener implements Listener { } com.gamingmesh.jobs.Signs.Sign signInfo = new com.gamingmesh.jobs.Signs.Sign(); + com.gamingmesh.jobs.Signs.SignUtil signUtil = Jobs.getSignUtil(); Location loc = sign.getLocation(); int category = 1; - if (Jobs.getSignUtil().getSigns().GetAllSigns().size() > 0) - category = Jobs.getSignUtil().getSigns().GetAllSigns().get(Jobs.getSignUtil().getSigns().GetAllSigns().size() - 1).GetCategory() + 1; + if (signUtil.getSigns().GetAllSigns().size() > 0) + category = signUtil.getSigns().GetAllSigns().get(signUtil.getSigns().GetAllSigns().size() - 1).GetCategory() + 1; + signInfo.setNumber(Number); signInfo.setWorld(loc.getWorld().getName()); signInfo.setX(loc.getX()); @@ -502,17 +504,17 @@ public class JobsListener implements Listener { signInfo.setJobName("gtoplist"); signInfo.setSpecial(special); - Jobs.getSignUtil().getSigns().addSign(signInfo); - Jobs.getSignUtil().saveSigns(); + signUtil.getSigns().addSign(signInfo); + signUtil.saveSigns(); event.setCancelled(true); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { if (!signtype.contains("gtoplist") && job != null) - Jobs.getSignUtil().SignUpdate(job.getName()); + signUtil.SignUpdate(job.getName()); else - Jobs.getSignUtil().SignUpdate("gtoplist"); + signUtil.SignUpdate("gtoplist"); return; } }, 1L);