java.lang.RuntimeException: Already decorating
whichonespink44 opened this issue ยท 14 comments
Crash report:
Relevant forum posts:
No, this is my old enemy the recursive decoration bug. As I posted, it isn't really our fault. I thought we could fix it by controlling how we set the instance var that sets off the bug but I don't see where to do it.
Zeno, I saw your idea for try/catching RTG's decoration calls.. any big negatives with doing that? (besides the performance hit)
You lose out on any decoration that happens after the crash. Highlands does it that way and I've never noticed anything, although it seems like there should be problems. It might be more of an issue with, say, an interrupted Stream than with a tree that's missing some branches. But there's always a config option option, so to speak.
The performance hit will be negligible because so much normally happens in decoration a try-catch setup is nothing.
You'd also lose out on the ability to notice errors unless you inspected the error on the catch. Probably should look for a RuntimeException that contains "already decorating" and otherwise re-throw it.
It could be that most of the time the decoration will get re-done via another pathway. Back in the old days I would have decoration routines called hundreds of times per chunk, literally - and sometimes they still wouldn't take effect!
Hmm, so we can inspect the exception and only 'fail silently' if it's the 'already decorating' crash?
This has to be a bit of a corner case as well. I was unable to reproduce this with Glenn's Gasses with RTG.
Also, I thought the issue may have been with The Camping Mod, since it also does it's own decorations, but I wasn't able to reproduce Already decorating, but I did get a whole pile of StackOverflowError some of which were Exception getting block type in world, but then those crashes magically just stopped and the mod started working as expected.
Yeah, I was thinking The Camping Mod might be part of the fun. These days such problems are almost always interaction bugs - if a mod has to deal with this problem, the author(s) have had to find out a way to handle it. And they've often been tricky to reproduce since whenever.
I'll add a config option for this tonight, but probably keep it disabled by default.
I think we can park this for now. We have the config option, right? And the problem turned out to be the Camping Mod.
I never added the config option because I didn't know how to test it and didn't want to introduce a new bug whilst trying to patch this one.
Well, it does seem to be a Camping Mod issue so I think we can put it aside until it comes up again.