TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Crucible dupe

DisasterMoo opened this issue ยท 2 comments

commented

Recent changes to small vessel heat recipe opened a bug in TECrucible. Basically, since the cached item isn't updated you end up with a duplicated small vessel because HeatRecipe does a copy

ItemStack and Capability instances both have to be updated after all this:

ItemStack inputStack = inventory.getStackInSlot(i);
IItemHeat cap = inputStack.getCapability(CapabilityItemHeat.ITEM_HEAT_CAPABILITY, null);
if (cap != null)
{
// Always heat up the item regardless if it is melting or not
if (cap.getTemperature() < temperature)
{
CapabilityItemHeat.addTemp(cap);
}
if (cachedRecipes[i] != null)
{
if (cachedRecipes[i].isValidTemperature(cap.getTemperature()))
{
alloy.add(inputStack, cachedRecipes[i]);
inventory.setStackInSlot(i, cachedRecipes[i].getOutputStack(inputStack));
markForSync();
}
}
}

(hint here is that inventory is re-updated from recipe but the instance isn't)

commented

Im not comletly sure what this means, but ive found that when heating up small vessels containing ore in a crucible the ore melts and liquid metal starts pouring into the crucible, but the amount in the vessel always stays the same, essentially making metal from nothing.

commented

That's essentially the dupe which i described above in code terms.