SimpleInventoryContainer.java 文件源码

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

项目:Transport-Pipes 作者:
private void updateOtherDoubleChestBlocks() {
    if (cachedInv.getHolder() instanceof DoubleChest) {
        Material chestMaterial = block.getType();
        Location otherChestLoc = null;
        for (WrappedDirection pd : WrappedDirection.values()) {
            if (pd.isSide()) {
                if (block.getRelative(pd.getX(), pd.getY(), pd.getZ()).getType() == chestMaterial) {
                    otherChestLoc = block.getRelative(pd.getX(), pd.getY(), pd.getZ()).getLocation();
                }
            }
        }
        Map<BlockLoc, TransportPipesContainer> containerMap = TransportPipes.instance
                .getContainerMap(block.getWorld());

        if (containerMap != null) {
            BlockLoc bl = BlockLoc.convertBlockLoc(otherChestLoc);
            if (containerMap.containsKey(bl)) {
                TransportPipesContainer tpc = containerMap.get(bl);
                if (tpc instanceof SimpleInventoryContainer) {
                    SimpleInventoryContainer sic = (SimpleInventoryContainer) tpc;
                    if (!(sic.cachedInv instanceof DoubleChestInventory)) {
                        sic.updateBlock();
                    }
                }
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号