diff options
author | Tahg <tahgtahv@gmail.com> | 2011-09-27 16:45:46 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-09-27 16:46:29 -0400 |
commit | 95666779f85c901081a5007de709cdff0950f2f1 (patch) | |
tree | 9661795c8b397dd9a0b401e60dfc994967ab132f /src/main/java/net/minecraft | |
parent | 40c8cc04215bcd05ad26caee10c9cb612657e131 (diff) | |
download | craftbukkit-95666779f85c901081a5007de709cdff0950f2f1.tar craftbukkit-95666779f85c901081a5007de709cdff0950f2f1.tar.gz craftbukkit-95666779f85c901081a5007de709cdff0950f2f1.tar.lz craftbukkit-95666779f85c901081a5007de709cdff0950f2f1.tar.xz craftbukkit-95666779f85c901081a5007de709cdff0950f2f1.zip |
added fallback code for invalid entities from mobspawners
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityMobSpawner.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityMobSpawner.java b/src/main/java/net/minecraft/server/TileEntityMobSpawner.java index 3af8e842..2f369456 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 |