[1.16.5] KubeJS Machine Upgrade: Input Multiplier
accessdenied0 opened this issue ยท 6 comments
Forge-version: 36.2.34
CM-version 1.16.5-0.5.7
I tried to add an Machine upgrade which reduces the required Machine Items per process.
My KubeJS code is:
`
onEvent('cm_upgrades', event => {
event.create(Item.of('kubejs:quantum_min_point'), 8)
.machine("custommachinery:quantum_min_chamber")
.mulInput('custommachinery:item', 0.75)
//.mulOutput('custommachinery:item', 2)
})`
The code got executed well with no errors but the items didn't got reduced. As test I edited the output (commented out) as reference and it worked very well in compare.
So I could increase the output per Upgrade but not reduce the required items per Upgrade.
But in my case I it would need kinda a way how to reduce the items needed per upgrade with the min of 1 per item...
I apologize if this issue already existed, not jet implemented, I did some error or if this issue is already known...
Try to update to latest version (1.16.5-0.5.8d) as a few internal things have changed about the recipe processing and upgrades.
If the issue still persist send the recipe and machine you were testing this upgrade in.
Oh yeah!
Amazing!
Sorry for the late response...
It not only fixed the specific slot issue I had (defined specific slot the item has to go in to craft but JEI and the machine just took what ever slot was open, now it works as intended)
It also properly reduced the cost of the recipe... very nice!
I just wish there would be a minimum usage as options... is the requirement if like the calculation gives 1< set to 0 or is it then a chance?
Like lets say you have 1 item and then reduce the required amount by 25%, which would be not possible obviously, use 0 up or is it then a chance?
I mean I think it is not easy to make an option for it, but it is also not that big of an issue...
I'm just super glad this issue got fixed! Thank you alot!
Nice that your issue was fixed.
Like lets say you have 1 item and then reduce the required amount by 25%, which would be not possible obviously, use 0 up or is it then a chance?
Currently I think it will be rounded to the lower integer value, so 1 - 0.25 = 0.75 will be rounded to 0 so 0 item will be consumed.
I think I can make it a chance to be consumed instead, so in that example the item will have 75% chance to be consumed.
About having a min or max value for upgrades that's not possible right now, but I add that to my to-do list (but that will probably be implemented in 1.18 and later only).
Sorry to bother you again but, I found an additional issue:
This setup only works if the recipe amount of items is present. That means the recipe won't work if the non-reduced amount of items.
If I have a recipe with 64 required items and use an upgrade to reduce it by 50%, the machine won't work without the 64 items in it, despite the fact it has an reduction of 50%... But I expected it to work with 32 items in it, because the costs got reduced...
What would be also nice is a way to display that change of rate, but I think that might be way to complicated...
I see, seems like the upgrades are not taken in account while searching for recipes to process, I will fix that in the next update.
What would be also nice is a way to display that change of rate, but I think that might be way to complicated...
Items that act as upgrades does have a tooltip to show their effect, other than that I don't think it is possible to display effect of upgrades directly on the recipe. (like in jei or in the machine gui).