From 3c4a02ed339a4850b1cad469cf494fa187ee6b86 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 2 Dec 2014 17:53:34 +0000 Subject: Filter invalid bounding boxes for entities This should prevent issues caused by broken horses --- nms-patches/Entity.patch | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'nms-patches/Entity.patch') diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 4fcd6b44..2e5bc544 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/Entity.java 2014-11-28 17:43:43.117707435 +0000 -+++ src/main/java/net/minecraft/server/Entity.java 2014-11-28 17:38:18.000000000 +0000 +--- ../work/decompile-8eb82bde//net/minecraft/server/Entity.java 2014-12-02 17:53:23.077821724 +0000 ++++ src/main/java/net/minecraft/server/Entity.java 2014-12-02 17:52:52.025822413 +0000 @@ -6,8 +6,40 @@ import java.util.UUID; import java.util.concurrent.Callable; @@ -576,3 +576,33 @@ } this.dead = true; +@@ -1680,8 +2042,27 @@ + return this.boundingBox; + } + +- public void a(AxisAlignedBB axisalignedbb) { +- this.boundingBox = axisalignedbb; ++ public void a(AxisAlignedBB axisalignedbb) { ++ // CraftBukkit start - block invalid bounding boxes ++ double a = axisalignedbb.a, ++ b = axisalignedbb.b, ++ c = axisalignedbb.c, ++ d = axisalignedbb.d, ++ e = axisalignedbb.e, ++ f = axisalignedbb.f; ++ double len = axisalignedbb.d - axisalignedbb.a; ++ if (len < 0) d = a; ++ if (len > 64) d = a + 64.0; ++ ++ len = axisalignedbb.e - axisalignedbb.b; ++ if (len < 0) e = b; ++ if (len > 64) e = b + 64.0; ++ ++ len = axisalignedbb.f - axisalignedbb.c; ++ if (len < 0) f = c; ++ if (len > 64) f = c + 64.0; ++ this.boundingBox = new AxisAlignedBB(a, b, c, d, e, f); ++ // CraftBukkit end + } + + public float getHeadHeight() { -- cgit v1.2.3