Another attempt of fixing OOB Horses. Just remove them from the world instead of setting it dead.

This commit is contained in:
Fabian Faßbender 2014-11-30 19:02:56 +01:00
parent cab7c772df
commit ebec73b5a9

View file

@ -1,5 +1,5 @@
--- ../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
--- ../work/decompile-8eb82bde//net/minecraft/server/EntityHorse.java Sun Nov 30 18:01:41 2014
+++ src/main/java/net/minecraft/server/EntityHorse.java Sun Nov 30 18:00:23 2014
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
@ -85,13 +85,14 @@
}
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) {
@@ -730,6 +746,13 @@
@@ -730,6 +746,14 @@
}
public void s_() {
+ // CraftBukkit start - Remove out of bounds horses, fixes an vanilla bug
+ if ( this.locY < -600 ) {
+ die();
+ world.removeEntity(this);
+ MinecraftServer.getLogger().warn("Removed oob horse. Prevented a crash for Horse @ " + this.locX + ", " + this.locY + ", " + this.locZ);
+ return;
+ }
+ // CraftBukkit end
@ -99,7 +100,7 @@
super.s_();
if (this.world.isStatic && this.datawatcher.a()) {
this.datawatcher.e();
@@ -949,6 +972,7 @@
@@ -949,6 +973,7 @@
nbttagcompound.setInt("Temper", this.getTemper());
nbttagcompound.setBoolean("Tame", this.isTame());
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID());
@ -107,7 +108,7 @@
if (this.hasChest()) {
NBTTagList nbttaglist = new NBTTagList();
@@ -1001,6 +1025,12 @@
@@ -1001,6 +1026,12 @@
this.setOwnerUUID(s);
}
@ -120,7 +121,7 @@
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
if (attributeinstance != null) {
@@ -1166,18 +1196,25 @@
@@ -1166,18 +1197,25 @@
public void v(int i) {
if (this.cE()) {