From 95666779f85c901081a5007de709cdff0950f2f1 Mon Sep 17 00:00:00 2001 From: Tahg Date: Tue, 27 Sep 2011 16:45:46 -0400 Subject: [PATCH] added fallback code for invalid entities from mobspawners --- .../java/net/minecraft/server/TileEntityMobSpawner.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/TileEntityMobSpawner.java b/src/main/java/net/minecraft/server/TileEntityMobSpawner.java index 3af8e8427a..2f36945655 100644 --- a/src/main/java/net/minecraft/server/TileEntityMobSpawner.java +++ b/src/main/java/net/minecraft/server/TileEntityMobSpawner.java @@ -28,7 +28,13 @@ public class TileEntityMobSpawner extends TileEntity { public void setId(int id) { mobName = EntityTypes.getNameFromClass(EntityTypes.getClassFromId(id)); - System.out.println("Setting mob type to: " + mobName); + if(mobName == null || mobName.isEmpty()) mobName = "Pig"; + try { + EntityTypes.a(mobName, world); + } + catch (Throwable t) { // If we get any error at all, fallback to a Pig + mobName = "Pig"; + } } // CraftBukkit end