Towdium / JustEnoughCalculation

A simple minecraft mod help you calculate the cost for recipes
Other
53 stars 39 forks source link

Suggestion - Infinite Loop prevention #31

Closed jezzen closed 7 years ago

jezzen commented 7 years ago

What this mod really needs is to check that the recipes you give don't loop.

As it is, whenever you try calculating a recipe with a loop Minecraft will crash and you need either a second calculator without that recipe current or remove it via NBT. I've had this happen on many an occasion.

It should be simple enough to have it as when you save the recipe, it will simulate the resources needed to craft it, and if it ends up requiring itself throw an exception telling the player as such and prevent it being added.

Towdium commented 7 years ago

Thanks for reporting! Actually I have some loop check and it worked before. I must have broke it somewhere. Will try to fix it soon.

jezzen commented 7 years ago

I've had it happen on things as simple as clay -> clay block -> clay.

Towdium commented 7 years ago

Should be fixed in the latest release 2.6.4 It might take some for curse to review the file.

jezzen commented 7 years ago

Ah, I meant that I'd previously had that happen. Not sure if you thought I was talking about the uploads you made, as I haven't tried them yet. Going to give it a try now

jezzen commented 7 years ago

Ok, gave them both a go, I did end up using clay to try. In 2.6.3 Minecraft stopped responding (presumably stack overflow) but didn't crash, and after forcing it to stop and restarting it seems to have not saved said recipes. However, the fix seems to work fine in 2.6.4, where it will just ignore the recipe back to the original.

Towdium commented 7 years ago

Yep! 2.6.4 is for the fix of the loop issue. 2.6.3 fixes another bug not related to this issue.

Towdium commented 7 years ago

Gonna close it. Do open another issue if it still happens.