From c37d5169809b2565f7575733bafd1650f2c8090c Mon Sep 17 00:00:00 2001 From: md678685 Date: Sun, 19 Aug 2018 21:16:16 +0100 Subject: [PATCH] Use MONSTER_EGG in SpawnEggRefl --- nms/ReflectionProvider/pom.xml | 5 +++++ .../src/net/ess3/nms/refl/SpawnEggRefl.java | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nms/ReflectionProvider/pom.xml b/nms/ReflectionProvider/pom.xml index 945dfa09e..c6831e8cb 100644 --- a/nms/ReflectionProvider/pom.xml +++ b/nms/ReflectionProvider/pom.xml @@ -18,5 +18,10 @@ NMSProvider 2.15.0 + + org.bukkit + bukkit + 1.12.2-R0.1-SNAPSHOT + \ No newline at end of file diff --git a/nms/ReflectionProvider/src/net/ess3/nms/refl/SpawnEggRefl.java b/nms/ReflectionProvider/src/net/ess3/nms/refl/SpawnEggRefl.java index 6838aae58..6f7f8617b 100644 --- a/nms/ReflectionProvider/src/net/ess3/nms/refl/SpawnEggRefl.java +++ b/nms/ReflectionProvider/src/net/ess3/nms/refl/SpawnEggRefl.java @@ -79,8 +79,7 @@ public class SpawnEggRefl { */ @SuppressWarnings("deprecation") public ItemStack toItemStack(int amount) throws Exception { - // TODO: Get off of the deprecated LEGACY material. - ItemStack item = new ItemStack(Material.LEGACY_MONSTER_EGG, amount); + ItemStack item = new ItemStack(Material.MONSTER_EGG, amount); Class craftItemStackClass = ReflUtil.getOBCClass("inventory.CraftItemStack"); Method asNMSCopyMethod = ReflUtil.getMethodCached(craftItemStackClass, "asNMSCopy", ItemStack.class); @@ -123,7 +122,7 @@ public class SpawnEggRefl { public static SpawnEggRefl fromItemStack(ItemStack item) throws Exception { if (item == null) throw new IllegalArgumentException("Item cannot be null"); - if (item.getType() != Material.LEGACY_MONSTER_EGG) + if (item.getType() != Material.MONSTER_EGG) throw new IllegalArgumentException("Item is not a monster egg"); Class NMSItemStackClass = ReflUtil.getNMSClass("ItemStack");