Skip to content

Commit

Permalink
Use MONSTER_EGG in SpawnEggRefl
Browse files Browse the repository at this point in the history
  • Loading branch information
mdcfe committed Sep 9, 2018
1 parent cdba518 commit 692e0ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions nms/ReflectionProvider/pom.xml
Expand Up @@ -18,5 +18,10 @@
<artifactId>NMSProvider</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 692e0ad

Please sign in to comment.