SignSubclaimListener.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:HCFCore 作者:
/**
 * Gets the attached {@link Sign}s on a {@link Block}.
 *
 * @param block
 *            the {@link Block} to get for
 * @return collection of attached {@link Sign}s
 */
public Collection<Sign> getAttachedSigns(Block block) {
    Set<Sign> results = new HashSet<>();
    getSignsAround(block, results);

    BlockState state = block.getState();
    if (state instanceof Chest) {
        Inventory chestInventory = ((Chest) state).getInventory();
        if (chestInventory instanceof DoubleChestInventory) {
            DoubleChest doubleChest = ((DoubleChestInventory) chestInventory).getHolder();
            Block left = ((Chest) doubleChest.getLeftSide()).getBlock();
            Block right = ((Chest) doubleChest.getRightSide()).getBlock();
            getSignsAround(left.equals(block) ? right : left, results);
        }
    }

    return results;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号