Modern Industrialization

Modern Industrialization

4M Downloads

Incompatibility with DimThreads

Closed this issue ยท 1 comments

commented

Hi! i am the author of DImthreads here
Some users reports me crashes on your mod when dimthreads is present and some buggy behaviors.

I am aware of what causes the issues so here is some potential solutions (benefical for both)

About the buggy behaviors

if (world instanceof ServerLevel serverLevel && serverLevel.getServer().isSameThread()) {

Multiblock doesn't need to run that ensurance of the thread because its running on the same level, chunkloading is async but chunk ticking is always "sync" on its own level (other mods can do async ticking on chunks but is a bad idea). Despite that, you can safety avoid any concerns of it using MinecraftServer#execute() or ServerLevel#getServer().execute. Is the approach that Dimthreads also takes for sensitive task like entity teleporting.

About the crashes

if (!server.isSameThread()) {
throw new RuntimeException("Thread is not server thread!");
}

Same as above... But this can be patched on my side. Mosly because dimthreads are "the server threads" of the level.

I want to hear more about why this was implemented like that, so i can help on investigate how to make a stable patch for the both sides :)

commented

I don't want to support dim threads.