Mowmaster/Pedestals

[Bug] Speed modification for `Smelter`/`Blast Furance`/`Smoker` doesn't use the proper amount of energy

Closed this issue · 0 comments

Discussed through Discord, the intention for speed is to simply speed up the crafts but not change their cost. In the current code (e.g. https://github.com/Mowmaster/Pedestals/blob/1.19-Forge/src/main/java/com/mowmaster/pedestals/Items/Upgrades/Pedestal/ItemUpgradeSmelter.java#L258-L264 for smelter), only a single "actions" worth of cost is removed when the upgrade does its work, while incrementCookingTime can add multiple "actions" worth of progress.

A simple enough fix on the cost-side, but will require either: (1) not allowing the upgrades to increment more than the total cookTime in a single tick (which would actually seem identical to the current behavior given how excess progress is thrown away but might be uglier in how that would have to be accessed as it would leak details through the new abstracted interface I created), or (2) account for excess progress properly (i.e. including the possibility of producing 2 items in a single action, which is probably how I'll tackle this to keep the newer abstraction clean).

Either way, I plan to fold this into the changes I'm making to these 3 alongside adding support for capacity.