From bf32933484273957cba99eda7689349662936e85 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 2 Jul 2019 10:47:00 +1000 Subject: [PATCH] SPIGOT-5133: Throwing items into secondary end world portal causes crash --- nms-patches/Entity.patch | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index bff6477163..873646881b 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -598,7 +598,7 @@ } public void j(boolean flag) { -@@ -2037,20 +2378,33 @@ +@@ -2037,33 +2378,46 @@ @Nullable public Entity a(DimensionManager dimensionmanager) { @@ -631,10 +631,27 @@ - BlockPosition blockposition; + BlockPosition blockposition = location; // CraftBukkit +- if (dimensionmanager1 == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) { + if (blockposition == null) { // CraftBukkit - if (dimensionmanager1 == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) { ++ if (dimensionmanager1.getType() == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) { // CraftBukkit blockposition = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn()); - } else if (dimensionmanager == DimensionManager.THE_END) { +- } else if (dimensionmanager == DimensionManager.THE_END) { ++ } else if (dimensionmanager.getType() == DimensionManager.THE_END) { // CraftBukkit + blockposition = worldserver1.getDimensionSpawn(); + } else { + double d0 = this.locX; + double d1 = this.locZ; + double d2 = 8.0D; + +- if (dimensionmanager1 == DimensionManager.OVERWORLD && dimensionmanager == DimensionManager.NETHER) { ++ if (dimensionmanager1.getType() == DimensionManager.OVERWORLD && dimensionmanager.getType() == DimensionManager.NETHER) { // CraftBukkit + d0 /= 8.0D; + d1 /= 8.0D; +- } else if (dimensionmanager1 == DimensionManager.NETHER && dimensionmanager == DimensionManager.OVERWORLD) { ++ } else if (dimensionmanager1.getType() == DimensionManager.NETHER && dimensionmanager.getType() == DimensionManager.OVERWORLD) { // CraftBukkit + d0 *= 8.0D; + d1 *= 8.0D; + } @@ -2088,6 +2442,25 @@ vec3d = shapedetector_shape.velocity; f = (float) shapedetector_shape.yaw;