Commits
1 - | --- ../work/decompile-8eb82bde//net/minecraft/server/MobSpawnerAbstract.java 2014-11-28 17:43:43.261707431 +0000 |
2 - | +++ src/main/java/net/minecraft/server/MobSpawnerAbstract.java 2014-11-28 17:38:17.000000000 +0000 |
1 + | --- ../work/decompile-8eb82bde//net/minecraft/server/MobSpawnerAbstract.java 2014-12-01 10:08:05.390591149 +0000 |
2 + | +++ src/main/java/net/minecraft/server/MobSpawnerAbstract.java 2014-12-01 10:07:23.810591600 +0000 |
3 3 | |
4 4 | import java.util.Iterator; |
5 5 | import java.util.List; |
6 6 | |
7 7 | +import org.bukkit.event.entity.CreatureSpawnEvent; // CraftBukkit |
8 8 | + |
9 9 | public abstract class MobSpawnerAbstract { |
10 10 | |
11 11 | public int spawnDelay = 20; |
12 - | |
12 + | |
13 + | |
14 + | public String getMobName() { |
15 + | if (this.i() == null) { |
16 + | + // CraftBukkit start - fix NPE |
17 + | + if (this.mobName == null) { |
18 + | + this.mobName = "Pig"; |
19 + | + } |
20 + | + // CraftBukkit end |
21 + | if (this.mobName.equals("Minecart")) { |
22 + | this.mobName = "MinecartRideable"; |
23 + | } |
24 + | |
13 25 | |
14 26 | entity.f(nbttagcompound); |
15 27 | if (entity.world != null && flag) { |
16 28 | - entity.world.addEntity(entity); |
17 29 | + entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit |
18 30 | } |
19 31 | |
20 32 | NBTTagCompound nbttagcompound1; |
21 - | |
33 + | |
22 34 | entity2.f(nbttagcompound2); |
23 35 | entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch); |
24 36 | if (entity.world != null && flag) { |
25 37 | - entity.world.addEntity(entity2); |
26 38 | + entity.world.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit |
27 39 | } |
28 40 | |
29 41 | entity1.mount(entity2); |
30 - | |
42 + | |
31 43 | } |
32 44 | } else if (entity instanceof EntityLiving && entity.world != null && flag) { |
33 45 | ((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null); |
34 46 | - entity.world.addEntity(entity); |
35 47 | + entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit |
36 48 | } |
37 49 | |
38 50 | return entity; |