Пример #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);
      }
    }
  }
Пример #2
0
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   inventory.writeToNBT(tagCompound);
 }
Пример #3
0
  public void transferElementToInventory() {
    if (!tileEntity.getWorldObj().isRemote) {

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