Ejemplo n.º 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);
      }
    }
  }
Ejemplo n.º 2
0
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   inventory.writeToNBT(tagCompound);
 }
Ejemplo n.º 3
0
 @Override
 public void readFromNBT(NBTTagCompound tagCompound) {
   super.readFromNBT(tagCompound);
   inventory.readFromNBT(tagCompound);
 }