public static Sign getRestrictedSign(Location location) {
Block currentBlock = location.getBlock();
if (BlockUtil.isSign(currentBlock)) {
Sign sign = (Sign) currentBlock.getState();
if (isRestricted(sign)) {
return sign;
} else {
return null;
}
}
for (BlockFace face : SIGN_CONNECTION_FACES) {
Block relative = currentBlock.getRelative(face);
if (!BlockUtil.isSign(relative)) {
continue;
}
Sign sign = (Sign) relative.getState();
if (!BlockUtil.getAttachedBlock(sign).equals(currentBlock)) {
continue;
}