From efc208379823e7f21a9e422a05d6cbcf9c73919d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 2 Mar 2022 15:47:15 +0000 Subject: [PATCH] Change the default sign orientation to better match the wall location --- .../com/plotsquared/bukkit/util/BukkitUtil.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index 73e9694da..8c51ddf6e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -347,13 +347,15 @@ public class BukkitUtil extends WorldUtil { final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ()); final Material type = block.getType(); if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) { - BlockFace facing = BlockFace.EAST; - if (world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) { - facing = BlockFace.NORTH; - } else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) { - facing = BlockFace.WEST; - } else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) { - facing = BlockFace.SOUTH; + BlockFace facing = BlockFace.NORTH; + if (!world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) { + if (world.getBlockAt(location.getX() - 1, location.getY(), location.getZ()).getType().isSolid()) { + facing = BlockFace.EAST; + } else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) { + facing = BlockFace.WEST; + } else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) { + facing = BlockFace.SOUTH; + } } if (PlotSquared.platform().serverVersion()[1] == 13) { block.setType(Material.valueOf(area.legacySignMaterial()), false);