public float checkTemps(IInventory inv) { float temp = 0; float[] temp1 = new float[inv.getSizeInventory()]; for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack is = inv.getStackInSlot(i); if (is != null && is.hasTagCompound() && !is.getItem().getUnlocalizedName(is).contains("Clay")) { if (is.getTagCompound().hasKey("temperature")) { temp1[i] = is.getTagCompound().getFloat("temperature"); if (temp1[i] < TFC_ItemHeat.getMeltingPoint(is)) { return (float) -1; } } else { return (float) -1; } } else if (is == null) { temp1[i] = -1; } } int temp2 = 0; for (int i = 0; i < inv.getSizeInventory(); i++) { if (temp1[i] >= 0) { temp += temp1[i]; temp2++; } } if (temp2 > 0) { temp /= temp2; } return temp; }
@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); } }