From 692e0adde47a53f5abe3ec971d38b7f9e817e4e7 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 945dfa09e95..c6831e8cbd2 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 6838aae589f..6f7f8617b4c 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 ItemStack toItemStack() throws Exception { */ @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 ItemStack toItemStack(int amount) throws Exception { 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");