@Override
 public void setInventorySlotContents(int slotId, ItemStack itemstack) {
   super.setInventorySlotContents(slotId, itemstack);
   if (TileAdvancedCraftingTable.this.getWorldObj() == null
       || !TileAdvancedCraftingTable.this.getWorldObj().isRemote)
     oreIDs[slotId] = itemstack == null ? -1 : OreDictionary.getOreID(itemstack);
 }
Example #2
0
  @Override
  public ItemStack getStackInSlotOnClosing(int slotId) {
    if (this._contents[slotId] == null) {
      return null;
    }

    ItemStack stackToTake = this._contents[slotId];
    setInventorySlotContents(slotId, null);
    return stackToTake;
  }
Example #3
0
 @Override
 public ItemStack decrStackSize(int slotId, int count) {
   if (slotId < _contents.length && _contents[slotId] != null) {
     if (_contents[slotId].stackSize > count) {
       ItemStack result = _contents[slotId].splitStack(count);
       markDirty();
       return result;
     }
     ItemStack stack = _contents[slotId];
     setInventorySlotContents(slotId, null);
     return stack;
   }
   return null;
 }
Example #4
0
  public void readFromNBT(NBTTagCompound data, String tag) {
    NBTTagList nbttaglist = data.getTagList(tag, Utils.NBTTag_Types.NBTTagCompound.ordinal());

    for (int j = 0; j < nbttaglist.tagCount(); ++j) {
      NBTTagCompound slot = nbttaglist.getCompoundTagAt(j);
      int index;
      if (slot.hasKey("index")) {
        index = slot.getInteger("index");
      } else {
        index = slot.getByte("Slot");
      }
      if (index >= 0 && index < _contents.length) {
        setInventorySlotContents(index, ItemStack.loadItemStackFromNBT(slot));
      }
    }
  }
  @Override
  public void setInventorySlotContents(int i, ItemStack itemstack) {
    inv.setInventorySlotContents(i, itemstack);

    if (i == 0) {
      if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof ItemBlueprint) {
        progressIn = 1;
      } else {
        progressIn = 0;
      }
    }

    if (i == 2) {
      if (getStackInSlot(2) != null && getStackInSlot(2).getItem() instanceof ItemBlueprint) {
        progressOut = 1;
      } else {
        progressOut = 0;
      }
    }
  }