From 88eede85cc3c98b3ab32d8f0cd2b9f6862758949 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 18 Nov 2016 15:32:27 +1100 Subject: [PATCH] SPIGOT-2792: Return PIG for broken spawners --- .../org/bukkit/craftbukkit/block/CraftCreatureSpawner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index a5fec06b83..2d070f8ee0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -24,7 +24,8 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa } public EntityType getSpawnedType() { - return EntityType.fromName(spawner.getSpawner().getMobName().a()); + MinecraftKey key = spawner.getSpawner().getMobName(); + return (key == null) ? EntityType.PIG : EntityType.fromName(key.a()); } public void setSpawnedType(EntityType entityType) {