Exemple #1
0
  @Override
  public void update() {
    super.update();
    if (!hasElement() && !inventory.isEmpty()) {
      int slot = inventory.getFirstValidSlot();
      ItemStack stack = inventory.getStackInSlot(slot);

      setElement(BlockData.rod);
      if (stack.stackTagCompound != null) {
        getPElementTile().readFromNBT(stack.stackTagCompound);
      }
      if (!tileEntity.getWorldObj().isRemote) {
        inventory.decrStackSize(slot, 1);
      }
    }
  }
Exemple #2
0
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   inventory.writeToNBT(tagCompound);
 }
Exemple #3
0
  public void transferElementToInventory() {
    if (!tileEntity.getWorldObj().isRemote) {

      inventory.addStackToInventory(getElementStack());
    }
  }
Exemple #4
0
 public boolean canTransfer() {
   ItemStack stack = getElementStack();
   if (CompareUtil.compareIDs(stack, ItemData.rod.item)) {
     return inventory.canInsert(getElementStack());
   } else return false;
 }
Exemple #5
0
 @Override
 public void readFromNBT(NBTTagCompound tagCompound) {
   super.readFromNBT(tagCompound);
   inventory.readFromNBT(tagCompound);
 }