Package org.bukkit.inventory

Examples of org.bukkit.inventory.FurnaceInventory


    final InventoryHolder toHolder = to.getHolder();
    final InventoryHolder fromHolder = from.getHolder();

    // Obtaining items from a furnace? Only use output slot!
    if (from instanceof FurnaceInventory) {
      final FurnaceInventory finv = (FurnaceInventory) from;
      from = new InventoryBase() {
        @Override
        public int getSize() {
          return 1;
        }

        @Override
        public ItemStack getItem(int index) {
          return finv.getResult();
        }

        @Override
        public void setItem(int index, ItemStack item) {
          finv.setResult(item);
        }
      };
    }

    // Do not deposit using animations for ground items, it shows duplicates which looks bad
View Full Code Here


    // First, clear furnaces.
    cleanFurnaces();

    // Then, look for furnace that need fuel or awaiting jobs.
    for (Furnace i : furnaces) {
      FurnaceInventory fInv = i.getInventory();
      ItemStack job = fInv.getSmelting();
      if ((job != null) && (job.getAmount() > 0)) {
        // If we're here, then there's obviously no fuel left.

        // First, refill with the same material.
        Material material = job.getType();
View Full Code Here

  /**
   * Clear surrounding furnaces.
   */
  private void cleanFurnaces() {
    for (Furnace i : furnaces) {
      FurnaceInventory fInv = i.getInventory();
      ItemStack result = fInv.getResult();
      if ((result != null) && (result.getAmount() != 0)) {
        // There's something to store.
        Material material = result.getType();
        int toStore = result.getAmount();
        for (Chest j : chest) {
          toStore = ChestHandler.deposit(material, toStore, j);
          if (toStore == 0) {
            break;
          }
        }
        result.setAmount(toStore);
        fInv.setResult(result);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.bukkit.inventory.FurnaceInventory

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.