/** * Turn one item from the combiner source stack into the appropriate smelted item in the combiner * result stack */ public void smeltItem() { if (this.canSmelt()) { ItemStack var1 = CombinerRecipes.smelting().getSmeltingResult(this.combinerItemStacks[0].getItem().itemID); if (this.combinerItemStacks[2] == null) { this.combinerItemStacks[2] = var1.copy(); } else if (this.combinerItemStacks[2].itemID == var1.itemID) { ++this.combinerItemStacks[2].stackSize; } --this.combinerItemStacks[0].stackSize; if (this.combinerItemStacks[0].stackSize <= 0) { this.combinerItemStacks[0] = null; } } }
/** * Returns true if the combiner can smelt an item, i.e. has a source item, destination stack isn't * full, etc. */ private boolean canSmelt() { if (this.combinerItemStacks[0] == null) { return false; } else { ItemStack var1 = CombinerRecipes.smelting().getSmeltingResult(this.combinerItemStacks[0].getItem().itemID); return var1 == null ? false : (this.combinerItemStacks[2] == null ? true : (!this.combinerItemStacks[2].isItemEqual(var1) ? false : (this.combinerItemStacks[2].stackSize < this.getInventoryStackLimit() && this.combinerItemStacks[2].stackSize < this.combinerItemStacks[2].getMaxStackSize() ? true : this.combinerItemStacks[2].stackSize < var1.getMaxStackSize()))); } }