Package forestry.core.utils

Examples of forestry.core.utils.InventoryAdapter


  IInventory playerIInventory;
  public PipeLogicPropolis pipeLogic;

  public ContainerPropolisPipe(IInventory playerInventory, PipeItemsPropolis pipe) {
    super(new InventoryAdapter(0, "Empty"));
    this.playerIInventory = playerInventory;
    this.pipeLogic = (PipeLogicPropolis) pipe.pipeLogic;

    for (int l = 0; l < 3; l++)
      for (int k1 = 0; k1 < 9; k1++)
View Full Code Here


  boolean isLinked;
  MachineTrader machine;

  public ContainerTradeName(InventoryPlayer player, MachineTrader tile) {
    super(new InventoryAdapter(0, "Empty"));
    machine = tile;
    isLinked = machine.isLinked();
  }
View Full Code Here

    private boolean locked;
    private World cachedWorld;
    private ItemStack cachedRecipeOutput;

    public Recipe(InventoryCrafting crafting) {
      this.matrix = new InventoryAdapter(new PlainInventory(crafting));
    }
View Full Code Here

      return recipeOutput != null && cachedRecipeOutput.isItemEqual(recipeOutput);
    }

    @Override
    public final void readFromNBT(NBTTagCompound nbttagcompound) {
      matrix = new InventoryAdapter(new InventoryCrafting(DUMMY_CONTAINER, 3, 3));
      matrix.readFromNBT(nbttagcompound);
      sanitizeMatrix();
      lastUsed = nbttagcompound.getLong("LastUsed");
      locked = nbttagcompound.getBoolean("Locked");
    }
View Full Code Here

  /* TRADING */
  public IInventory getOrCreateTradeInventory() {

    // Handle client side
    if (!Proxies.common.isSimulating(worldObj))
      return new InventoryAdapter(TradeStation.SLOT_SIZE, "INV");

    if (!address.isValid())
      return new InventoryAdapter(TradeStation.SLOT_SIZE, "INV");

    return PostManager.postRegistry.getOrCreateTradeStation(worldObj, getOwnerProfile(), address);
  }
View Full Code Here

  /* MAIL HANDLING */

  public IInventory getOrCreateMailInventory(World world, GameProfile playerProfile) {
    if (!Proxies.common.isSimulating(world))
      return new InventoryAdapter(POBox.SLOT_SIZE, "Letters");

    IMailAddress address = PostManager.postRegistry.getMailAddress(playerProfile);
    return PostRegistry.getOrCreatePOBox(worldObj, address);
  }
View Full Code Here

    return (int) Math.floor(itemCount / tradegood.stackSize);
  }

  public boolean canReceivePayment() {
    InventoryAdapter test = inventory.copy();
    ItemStack [] payment = inventory.getStacks(SLOT_EXCHANGE_1, SLOT_EXCHANGE_COUNT);

    return test.tryAddStacksCopy(payment, SLOT_RECEIVE_BUFFER, SLOT_RECEIVE_BUFFER_COUNT, true);
  }
View Full Code Here

    return test.tryAddStacksCopy(payment, SLOT_RECEIVE_BUFFER, SLOT_RECEIVE_BUFFER_COUNT, true);
  }

  private int countStorablePayment(int max, ItemStack[] exchange) {
   
    InventoryAdapter test = inventory.copy();
    int count = 0;

    for (int i = 0; i < max; i++) {
      if (test.tryAddStacksCopy(exchange, SLOT_RECEIVE_BUFFER, SLOT_RECEIVE_BUFFER_COUNT, true))
        count++;
      else
        break;
    }
View Full Code Here

TOP

Related Classes of forestry.core.utils.InventoryAdapter

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.