OpenComputers II

OpenComputers II

27.1k Downloads

Placing a robot down crashed the game.

AshtonSnapp opened this issue ยท 15 comments

commented

Hello!

I recently installed OC2 to my Forge 1.18 install and am hooked. However, in my test world, I tried to place a robot down on top of a charger and the game froze for a couple seconds, before the "Saving world..." screen came up and the game closed. While as far as my OS and the launcher care it shut down normally (if the exit code was non-zero the launcher would have popped up with an error message), this was definitely a crash. I'm not sure what happened. If I had a crash log, I would provide it. However, again, as far as my laptop cares, it didn't crash. So there's no crash log.

commented

it should still generate a log file in the .minecraft/logs folder. "latest.log" should be the log file for that last launch you did

commented

Never mind the link is working now.

From what i can tell it may be a possible mod conflict, What other mods do you having installed?

commented

Ah, thanks for letting me know. When I get back to my laptop (currently on phone) I'll look for the log and add it to this issue.

commented

Im unable to open the pastebin link it says its private or pending moderation
image

commented

Strange. I had set it to unlisted, but you still should have been able to view it as unlisted. I just set it to public, see if that lets you see it. If not, then maybe Pastebin just doesn't like the log file. I don't know.

commented

its still giving the same issue. you should be able upload the log by dragging and dropping the file in here

commented

Thanks for reporting. Looks like another mod is accessing capabilities from the AttachCapabilities event, which is fired before the robot entity is fully constructed. Which, IMHO, shouldn't be allowed (because accessing an object from the outside that isn't fully constructed is never a good idea). But I guess it has to be accounted for, since Forge's API makes this seem like a reasonable thing to do. Will work around.

commented

Interesting. I don't know much about the Forge APIs, but it could possibly be Advanced Peripherals, CC:Tweaked (I haven't removed it), or Create Crafts and Additions. Those are the only other mods I can think of in my mods folder that even know about computers, although I'll have to get a full mod list to y'all sometime today.

commented

None of those mods you mentioned are the cause. This is a bug in StructureGel, they are checking for the existence of a capability at a point in time where it can't exist yet: https://gitlab.com/modding-legacy/structure-gel-api/-/blob/1.18.x/src/main/java/com/legacy/structure_gel/core/events/SGCommonEvents.java#L175-182.

@fnuecke I would recommend to not work around this as it is a serious bug in the other mod and should be fixed on their end.

commented

Yes, StructureGel is the one. As for it being a but on their side... is it though? Forge gives out a reference via getObject to an uninitialized instance. It's more of design flaw of Forge, really. Reason I'll probably add a check either way, is that this means other mods are likely to fall for the same trap. But sure, I can open a ticket on their end. Using the capabilities already registered with the event may be good enough for them.

commented

I am writing a ticket right now. The reason why the event gives you a reference to the object is to allow the capability to keep a reference to the object it is attached to for later use in the capability's logic.

EDIT: StructureGel ticket: https://gitlab.com/modding-legacy/structure-gel-api/-/issues/24

commented

Cool, thanks!

commented

Likely off topic but the cause of this bug gets figured out surprisingly fast.

commented

I was about to post a mod list, but y'all figured that out fast. Structure Gel is required by one of the mods I have (can't remember which one, and CurseForge doesn't have a way to search just for dependent mods and not modpacks :/). I'll have to wait until Structure Gel gets updated to fix this before messing around with robots, but glad this is getting sorted out.