mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Use MONSTER_EGG in SpawnEggRefl
This commit is contained in:
parent
b27a6b5b8e
commit
c37d516980
@ -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>
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user