Uggh, It looks like I'm back again, haha. Ok, so I have a speed upgrade for my custom machine and I have a slot to install speed upgrades. My problem is the recipes work when there is no speed upgrade in. When I put the speed upgrade in, the values for the recipes don't return as intended.
I'll use an example of a recipe.
25 cobblestone (1500 burn required) needs to be "smelted" with 2 paper (750 burn) for the ratio.
Without speed upgrades, it should go at a rate of 50 per .updateEntity(),
Input Paper 1
etc ____ etc
When you add upgrades, it should speed up proportionally.
Redstone is worth .2 to the speed so 1 redstone runs it at 1.2x speed.
I can't seem to wrap my head around this math involved. I know it isn't:
CookTime += this.cookTick * this.getSpeed()
BurnTime -= this.cookTick * this.getSpeed()
Because that makes it more efficient along with speedy (i.e. at speed ratio of 2, it runs twice as fast but also twice as energy efficient)
How do I get the math right for this? As for code, if you REALLY need it, I can post it, but it's kinda messy right now after all my tinkering to fit in my new fuel system. I haven't reorganized it yet. But I honestly don't think you should need the code because its just replacing the standard 200 cook time of the minecraft furnace per recipe, grabbing based on the item instead of a flat rate for all items.
Here is the code, I expanded all the values to account for the getSpeed(), but still running at a 1:1 speed.
Ehh I figured it out, lol when I multiply the stuff removed by the speed, I must divide the total amount at the start by the speed. Lol I'm so stupid for not thinking this one through, good job me (and to think they placed me into Calc II for college this fall...)
Rollback Post to RevisionRollBack
Mod Author and Owner of Blockhole
Owner of other discontinued or status frozen work: LimpCraft2, LimpCore, InventoryCalculator, VillageTech, Bitto'Color.