SPIGOT-451: Fix bad entities crashing servers when spawned via MobSpawner

This commit is contained in:
Zach Brown 2015-01-18 02:11:36 -06:00 committed by md_5
parent 1092acbddf
commit e08f5e3d35

View File

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/MobSpawnerAbstract.java 2014-12-01 10:08:05.390591149 +0000
+++ src/main/java/net/minecraft/server/MobSpawnerAbstract.java 2014-12-01 10:07:23.810591600 +0000
--- ../work/decompile-8eb82bde//net/minecraft/server/MobSpawnerAbstract.java 2015-01-18 01:59:59.240758959 -0600
+++ src/main/java/net/minecraft/server/MobSpawnerAbstract.java 2015-01-18 01:59:59.244758959 -0600
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
@ -39,9 +39,12 @@
}
entity1.mount(entity2);
@@ -164,7 +171,7 @@
@@ -162,9 +169,9 @@
entity1 = entity2;
}
} else if (entity instanceof EntityLiving && entity.world != null && flag) {
- } else if (entity instanceof EntityLiving && entity.world != null && flag) {
+ } else if (entity instanceof EntityInsentient && entity.world != null && flag) { // CraftBukkit - EntityLiving -> EntityInsentient
((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null);
- entity.world.addEntity(entity);
+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit