From f1176c260519a1660cc890d5252dfd4aa7d89c9a Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 6 May 2020 23:57:32 +0200 Subject: [PATCH] Add support for fence gates and trapdoors with door signs --- .../dungeonsxl/sign/rocker/OpenDoorSign.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/OpenDoorSign.java b/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/OpenDoorSign.java index e572807d..a49a70fe 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/OpenDoorSign.java +++ b/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/OpenDoorSign.java @@ -77,10 +77,22 @@ public class OpenDoorSign extends Rocker { return true; } + @Deprecated + public static final java.util.Set FENCE_GATES = new java.util.HashSet<>(6); + + static { + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.OAK_FENCE_GATE.getMaterial()); + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.ACACIA_FENCE_GATE.getMaterial()); + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.DARK_OAK_FENCE_GATE.getMaterial()); + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.SPRUCE_FENCE_GATE.getMaterial()); + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.BIRCH_FENCE_GATE.getMaterial()); + FENCE_GATES.add(de.erethon.caliburn.item.VanillaItem.JUNGLE_FENCE_GATE.getMaterial()); + } + @Override public void initialize() { Block block = BlockUtil.getAttachedBlock(getSign().getBlock()); - if (Category.DOORS.containsBlock(block)) { + if (Category.DOORS.containsBlock(block) || FENCE_GATES.contains(block.getType()) || Category.TRAPDOORS.containsBlock(block)) { if (block.getRelative(BlockFace.DOWN).getType() == block.getType()) { door = new LockedDoor(api, block.getRelative(BlockFace.DOWN)); } else {