CC: Tweaked

CC: Tweaked

42M Downloads

Any turtle from modification shown as "Minecraft" related in JEI

SirEdvin opened this issue ยท 2 comments

commented

Minecraft Version

1.16.x

Version

1.97.0

Details

As I understand, main problem is here.

Can this be changed somehow?)

commented

OK, it's going to be a right pain to make this thread-safe without putting locks everywhere. Will submit a PR to Forge to see if we can set the active mod container elsewhere and have added 11b40bb to make sure we don't report the wrong one.

The other alternative (which is what CC does) is to register upgrades when registering items (i.e. your RegistryEvent.Register<Item> handler).

commented

Problem is probably here:

https://github.com/SquidDev-CC/CC-Tweaked/blob/a1821035d3eb167d6ac4017368297ec48ce1bf98/src/main/java/dan200/computercraft/shared/TurtleUpgrades.java#L37

If you switch to registering your turtles during the FMLCommonSetupEvent, rather than in a deferred work queue, then it'll work. Fairly sure all of CC's stuff is thread-safe. It's not! I should probably fix that.

Ideally Forge would set the active mod when running deferred tasks - maybe I'll look into submitting a PR for that.