From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MisterErwin 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 479693f9703f743c8e64bb6b949b2803109f4fa0..2c4ffaa4e9ce7759e6782547300ec6f457530c3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1883,7 +1883,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 BlockPos pos = new BlockPos(x, y, z); for (BlockFace dir : faces) { net.minecraft.world.level.block.state.BlockState nmsBlock = this.world.getBlockState(pos.relative(CraftBlock.blockFaceToNotch(dir)));