Package org.bukkit.inventory

Examples of org.bukkit.inventory.DoubleChestInventory


      while (iter.hasNext()) {
        BlockState next = iter.next();
        if (!(next instanceof Chest)) {
          continue;
        }
        DoubleChestInventory inventory = CommonUtil.tryCast(((Chest) next).getInventory(), DoubleChestInventory.class);
        if (inventory == null) {
          continue;
        }
        if (chestsBuffer.add(inventory.getLeftSide().getHolder()) &&
            chestsBuffer.add(inventory.getRightSide().getHolder())) {
          continue;
        }
        // Already added chest(s), disregard
        iter.remove();
      }
View Full Code Here


    private Inventory getBlockInventory(Chest chest) {
        try {
            return chest.getBlockInventory();
        } catch (Throwable t) {
            if (chest.getInventory() instanceof DoubleChestInventory) {
                DoubleChestInventory inven = (DoubleChestInventory) chest.getInventory();
                if (inven.getLeftSide().getHolder().equals(chest)) {
                    return inven.getLeftSide();
                } else if (inven.getRightSide().getHolder().equals(chest)) {
                    return inven.getRightSide();
                } else {
                    return inven;
                }
            } else {
                return chest.getInventory();
View Full Code Here

TOP

Related Classes of org.bukkit.inventory.DoubleChestInventory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.