summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorFabian Faßbender <fabian.fassbender42@googlemail.com>2014-11-30 00:53:25 +0100
committerFabian Faßbender <fabian.fassbender42@googlemail.com>2014-11-30 01:03:59 +0100
commitc8a76994dcad959b306d6e84e0b73f23571f3e14 (patch)
tree23749a6ebc94bc6cf71dcd23bcacb57c4b5c4d54 /nms-patches
parentcef65526d4a524452eaf59b22015ba021a02b001 (diff)
downloadcraftbukkit-c8a76994dcad959b306d6e84e0b73f23571f3e14.tar
craftbukkit-c8a76994dcad959b306d6e84e0b73f23571f3e14.tar.gz
craftbukkit-c8a76994dcad959b306d6e84e0b73f23571f3e14.tar.lz
craftbukkit-c8a76994dcad959b306d6e84e0b73f23571f3e14.tar.xz
craftbukkit-c8a76994dcad959b306d6e84e0b73f23571f3e14.zip
Horses spawned under Y 0 cause CraftBukkit to crash. This happens a lot since people keep using bugged Horses for Holographics
Remove out of bounds horses, fixes an vanilla bug. Fixes SPIGOT-58
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityHorse.patch28
1 files changed, 21 insertions, 7 deletions
diff --git a/nms-patches/EntityHorse.patch b/nms-patches/EntityHorse.patch
index 7fc41c73..d6d606e1 100644
--- a/nms-patches/EntityHorse.patch
+++ b/nms-patches/EntityHorse.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/EntityHorse.java 2014-11-28 17:43:43.101707435 +0000
-+++ src/main/java/net/minecraft/server/EntityHorse.java 2014-11-28 17:38:22.000000000 +0000
+--- ../work/decompile-8eb82bde//net/minecraft/server/EntityHorse.java Sun Nov 30 00:00:30 2014
++++ src/main/java/net/minecraft/server/EntityHorse.java Sun Nov 30 00:00:14 2014
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
@@ -61,12 +61,12 @@
}
+ // CraftBukkit end */
+ }
-
++
+ // CraftBukkit start - Add method
+ @Override
+ protected void dropDeathLoot(boolean flag, int i) {
+ super.dropDeathLoot(flag, i);
-+
+
+ // Moved from die method above
+ if (!this.world.isStatic) {
+ this.dropChest();
@@ -85,7 +85,21 @@
}
if (!this.cw() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(new BlockPosition(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ))).getBlock() == Blocks.GRASS) {
-@@ -949,6 +965,7 @@
+@@ -730,6 +746,13 @@
+ }
+
+ public void s_() {
++ // CraftBukkit start - Remove out of bounds horses, fixes an vanilla bug
++ if ( this.locY < -600 ) {
++ die();
++ return;
++ }
++ // CraftBukkit end
++
+ super.s_();
+ if (this.world.isStatic && this.datawatcher.a()) {
+ this.datawatcher.e();
+@@ -949,6 +972,7 @@
nbttagcompound.setInt("Temper", this.getTemper());
nbttagcompound.setBoolean("Tame", this.isTame());
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID());
@@ -93,7 +107,7 @@
if (this.hasChest()) {
NBTTagList nbttaglist = new NBTTagList();
-@@ -1001,6 +1018,12 @@
+@@ -1001,6 +1025,12 @@
this.setOwnerUUID(s);
}
@@ -106,7 +120,7 @@
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
if (attributeinstance != null) {
-@@ -1166,18 +1189,25 @@
+@@ -1166,18 +1196,25 @@
public void v(int i) {
if (this.cE()) {