Esempio n. 1
0
 @Override
 public ItemStack transferStackInSlot(EntityPlayer player, int i) {
   Slot slot = (Slot) inventorySlots.get(i);
   Slot slotpaper = (Slot) inventorySlots.get(1);
   if (slot != null && slot.getHasStack()) {
     ItemStack itemstack1 = slot.getStack();
     if (i <= 8) {
       if (!this.mergeItemStack(itemstack1, 9, this.inventorySlots.size(), true)) {
         return null;
       }
     }
     if (itemstack1.stackSize == 0) {
       slot.putStack(null);
     } else {
       slot.onSlotChanged();
     }
   }
   return null;
 }
 @Override
 public void putStack(ItemStack par1ItemStack) {
   super.putStack(par1ItemStack);
   if (par1ItemStack != null
       && par1ItemStack.getItem() != null
       && par1ItemStack.getItem() instanceof ItemFood
       && par1ItemStack.hasTagCompound()) {
     NBTTagCompound stackTagCompound = par1ItemStack.getTagCompound();
     if (stackTagCompound == null || !stackTagCompound.getBoolean("frypanKill")) {
       return;
     }
     player.addStat(TAchievements.achievements.get("tconstruct.dualConvenience"), 1);
   }
 }