Wanted to ask something.
I noticed that refining keeps using up raw resources till it runs out.
What happens when insufficient amount gets used up?
Are those resources gone or does mod remembers unfinished refining progress from previous time and resumes?
Basically if (numbers pulled out of my rear) platinum needs 100 ore, you have 140, refining gives 1 platinum but uses 140 ore, if I acquire 60 more ore and refine that, will one more platinum be made or initial 40 and later 60 ore are gone?
Conversion happens frame-by-frame using applyEffect(float amount, float level), and each frame a tiny fraction of the full day's input is subtracted and a tiny fraction of the full day's output is added. The fraction part here is important - cargo is a float value mechanically, so what you see as 5 platinum in cargo screen might be actually 5.42 platinum. So in some sense yes, I would imagine that "progress" on the refining is saved, so long as you do not sell the output before a new unit is produced, since game does not account for price of anything left over after the integer.
That said, I do have a bit of the input on code:
float supply = fleet.getCargo().getCommodityQuantity(jydr_Items.PLATINUM);
} else if(supply >= fleet.getCargo().getMaxCapacity()) {
fleet.addFloatingText("Full of Platinum", Misc.setAlpha(entity.getIndicatorColor(), 255), 0.5f);
deactivate();
}
What this part does is restricts conversion if there is more units of platinum in the cargo holds than the fleet cargo capacity itself; Not only you'll never have a situation where this happens in normal ingame conditions, the restriction itself is counterproductive since conversion process is a net shrink of cargo, so you want it running even when cargo holds are full.