Fixed an issue with zombie pigmen and spawners.

This commit is contained in:
Brianna 2019-10-20 11:54:17 -04:00
parent 50e4cdef31
commit 57735defa4

View File

@ -82,7 +82,9 @@ public class SpawnerListeners implements Listener {
EntityType entityType; EntityType entityType;
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13))
entityType = EntityType.valueOf(itemType.name().replace("_SPAWN_EGG", "").replace("MOOSHROOM", "MUSHROOM_COW")); entityType = EntityType.valueOf(itemType.name().replace("_SPAWN_EGG", "")
.replace("MOOSHROOM", "MUSHROOM_COW")
.replace("ZOMBIE_PIGMAN", "PIG_ZOMBIE"));
else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_12)) { else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_12)) {
String str = Reflection.getNBTTagCompound(Reflection.getNMSItemStack(event.getItem())).toString(); String str = Reflection.getNBTTagCompound(Reflection.getNMSItemStack(event.getItem())).toString();
if (str.contains("minecraft:")) if (str.contains("minecraft:"))