示例#1
0
  @Override
  public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
    if (slot == 0 && tile.getStackInSlot(slot) != null) {
      if (!player.worldObj.isRemote) {
        tile.setInventorySlotContents(slot, null);
        tile.checkLockAndUpdate();
        this.detectAndSendChanges();
      }

      return null;
    }

    return super.slotClick(slot, button, flag, player);
  }