summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-12-01 10:08:17 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-01 10:08:17 +0000
commitd2c263030739df5529e0fb1c29469c052eacd484 (patch)
tree07642e3f29b26be32c7a7ca6a68b86450ee0238a /nms-patches
parent1af2540f784a8610a6ee743cf944eca5933a12c9 (diff)
downloadcraftbukkit-d2c263030739df5529e0fb1c29469c052eacd484.tar
craftbukkit-d2c263030739df5529e0fb1c29469c052eacd484.tar.gz
craftbukkit-d2c263030739df5529e0fb1c29469c052eacd484.tar.lz
craftbukkit-d2c263030739df5529e0fb1c29469c052eacd484.tar.xz
craftbukkit-d2c263030739df5529e0fb1c29469c052eacd484.zip
SPIGOT-85: Fix NPE in monster spawners when right-clicked with invalid spawn eggs
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/MobSpawnerAbstract.patch22
1 files changed, 17 insertions, 5 deletions
diff --git a/nms-patches/MobSpawnerAbstract.patch b/nms-patches/MobSpawnerAbstract.patch
index 31d2d405..cd1aa977 100644
--- a/nms-patches/MobSpawnerAbstract.patch
+++ b/nms-patches/MobSpawnerAbstract.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/MobSpawnerAbstract.java 2014-11-28 17:43:43.261707431 +0000
-+++ src/main/java/net/minecraft/server/MobSpawnerAbstract.java 2014-11-28 17:38:17.000000000 +0000
+--- ../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
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
@@ -9,7 +9,19 @@
public abstract class MobSpawnerAbstract {
public int spawnDelay = 20;
-@@ -129,7 +131,7 @@
+@@ -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.equals("Minecart")) {
+ this.mobName = "MinecartRideable";
+ }
+@@ -129,7 +136,7 @@
entity.f(nbttagcompound);
if (entity.world != null && flag) {
@@ -18,7 +30,7 @@
}
NBTTagCompound nbttagcompound1;
-@@ -154,7 +156,7 @@
+@@ -154,7 +161,7 @@
entity2.f(nbttagcompound2);
entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch);
if (entity.world != null && flag) {
@@ -27,7 +39,7 @@
}
entity1.mount(entity2);
-@@ -164,7 +166,7 @@
+@@ -164,7 +171,7 @@
}
} else if (entity instanceof EntityLiving && entity.world != null && flag) {
((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null);