summaryrefslogtreecommitdiffstats
path: root/nms-patches/MobSpawnerAbstract.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-01 08:32:46 +1100
committermd_5 <git@md-5.net>2016-03-01 09:32:45 +1100
commitaa008dff0f9bedbe88e1fe79831776b0a52eb90a (patch)
treecb520e0f4cc5d683fb9b7fb95de37480a7443dfb /nms-patches/MobSpawnerAbstract.patch
parente1ebe524a78e27f6a2829ed4574fded3779094e1 (diff)
downloadcraftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.gz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.lz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.xz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.zip
Update to Minecraft 1.9
Diffstat (limited to 'nms-patches/MobSpawnerAbstract.patch')
-rw-r--r--nms-patches/MobSpawnerAbstract.patch57
1 files changed, 9 insertions, 48 deletions
diff --git a/nms-patches/MobSpawnerAbstract.patch b/nms-patches/MobSpawnerAbstract.patch
index ccf99ef2..408e3a46 100644
--- a/nms-patches/MobSpawnerAbstract.patch
+++ b/nms-patches/MobSpawnerAbstract.patch
@@ -1,50 +1,11 @@
--- a/net/minecraft/server/MobSpawnerAbstract.java
+++ b/net/minecraft/server/MobSpawnerAbstract.java
-@@ -4,6 +4,8 @@
- import java.util.Iterator;
- import java.util.List;
-
-+import org.bukkit.event.entity.CreatureSpawnEvent; // CraftBukkit
-+
- public abstract class MobSpawnerAbstract {
-
- public int spawnDelay = 20;
-@@ -24,6 +26,11 @@
-
- public String getMobName() {
- if (this.i() == null) {
-+ // CraftBukkit start - fix NPE
-+ if (this.mobName == null) {
-+ this.mobName = "Pig";
-+ }
-+ // CraftBukkit end
- if (this.mobName != null && this.mobName.equals("Minecart")) {
- this.mobName = "MinecartRideable";
- }
-@@ -129,7 +136,7 @@
-
- entity.f(nbttagcompound);
- if (entity.world != null && flag) {
-- entity.world.addEntity(entity);
-+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
- }
-
- NBTTagCompound nbttagcompound1;
-@@ -154,7 +161,7 @@
- entity2.f(nbttagcompound2);
- entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch);
- if (entity.world != null && flag) {
-- entity.world.addEntity(entity2);
-+ entity.world.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
- }
-
- entity1.mount(entity2);
-@@ -167,7 +174,7 @@
- ((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null);
- }
-
-- entity.world.addEntity(entity);
-+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
- }
-
- return entity;
+@@ -95,7 +95,7 @@
+ ((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
+ }
+
+- ChunkRegionLoader.a(entity, world);
++ ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ world.triggerEffect(2004, blockposition, 0);
+ if (entityinsentient != null) {
+ entityinsentient.doSpawnEffect();