diff options
author | MisterErwin <[email protected]> | 2019-10-30 18:29:40 +0100 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2019-10-30 17:29:40 +0000 |
commit | 0c715390939bb2b46319fec03a224fdc2038b739 (patch) | |
tree | 0f00ef6ce92e3d77bc8a01e6ee4b1161de337d7a | |
parent | 527073aa65dc358e46731b0a0c7e0518b21490f5 (diff) | |
download | Paper-0c715390939bb2b46319fec03a224fdc2038b739.tar.gz Paper-0c715390939bb2b46319fec03a224fdc2038b739.zip |
[PATCH] bounding box check for hanging entities (#2664)
This patch intends to fix an issue with LeashHitchs where an exception
was thrown due EntityHanging#calculateBoundingBox not being able to
accept EnumDirections UP and DOWN.
This issue was introduced in a fix for SPIGOT-4674
(d65a2576e40e58c8e446b330febe6799d13a604f)
-rw-r--r-- | Spigot-Server-Patches/0420-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0420-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch b/Spigot-Server-Patches/0420-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch new file mode 100644 index 0000000000..e0f2c454ca --- /dev/null +++ b/Spigot-Server-Patches/0420-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch @@ -0,0 +1,28 @@ +From c41ab1dad3a063b15b9ceb44645c0ef99ffbae24 Mon Sep 17 00:00:00 2001 +From: MisterErwin <[email protected]> +Date: Wed, 30 Oct 2019 16:57:54 +0100 +Subject: [PATCH] Fix spawning of hanging entities that are not ItemFrames and + can not face UP or DOWN + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 243722b6..f33d9c8b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -1784,7 +1784,12 @@ public class CraftWorld implements World { + height = 9; + } + +- BlockFace[] faces = new BlockFace[]{BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN}; ++ // Paper start - In addition to d65a2576e40e58c8e446b330febe6799d13a604f do not check UP/DOWN for non item frames ++ // BlockFace[] faces = new BlockFace[]{BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN}; ++ BlockFace[] faces = (ItemFrame.class.isAssignableFrom(clazz)) ++ ? new BlockFace[]{BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN} ++ : new BlockFace[]{BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH}; ++ // Paper end + final BlockPosition pos = new BlockPosition(x, y, z); + for (BlockFace dir : faces) { + IBlockData nmsBlock = world.getType(pos.shift(CraftBlock.blockFaceToNotch(dir))); +-- +2.17.1 + |