/**
* 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;
}
SignSubclaimListener.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:HCFCore
作者:
评论列表
文章目录