Skip to content

2No2Name/worldthreader

Repository files navigation

Worldthreader Mod

This project is a free and open-source Minecraft mod which optimizes the processing of multiple dimensions, by ticking dimensions in parallel on one thread each. Thread safety of operations like teleporting between dimensions or executing commands which affect another dimension is ensured. After each tick the dimensions wait for each other to ensure that all dimensions run at the same speed to avoid breaking interdimensional timing sensitive redstone contraptions. More work is required on thread-safe updating game rules, scoreboards, the world border and similar shared data.

The mod works on both the client (singleplayer) and server, and does not require the mod to be installed on both sides.

Downloads

You can find downloads for Worldthreader on the GitHub releases page.

Installing

Install the Fabric Loader. Select Fabric for either the Minecraft launcher (client) or the dedicated server (server). Once you have installed Fabric, move theWorldthreader.jarand theFabric-API.jarinto the/modsfolder generated by Fabric.


Configuration

  • /gamerule worldthreader_Active <true/false> enables/disables the mod
  • /gamerule worldthreader_AdditionalEntityTickAfterTeleport enables/disables ticking entities immediately after teleporting from the main overworld to the nether or end to simulate the timings of vanilla portal use
  • /gamerule worldthreader_CreateNetherPortalsForAllEntities <true/false> enables/disables all entities being able to generate nether portals. Fallback when no portals are generated/found: Entities are teleported back to the portal they entered, which is mostly seamless.

FAQ

Does the mod change Vanilla behaviour?

Worldthreader aims to conserve vanilla-parity in most points.

Behavior that is based on the timing of entities going through portals might be delayed by a gametick when the entity is leaving the overworld. However /gamerule worldthreader_AdditionalEntityTickAfterTeleport ticks entities which are not teleporting to the overworld once after being placed in the world. This should allow them to catch up on the tick they missed out on. However this happens at the end of the tick, meaning that no other mobs or pistons were able to push or damage the entity in that tick, because it hasn't been there yet.

In vanilla, nether portals do not teleport non-player entities when there is no nether portal in range in the other dimension. However, worldthreader optimistically assumes a portal will be found in the other dimension for thread-safety and improved parallelism. If no portal is found, either a portal is generated (cf. /gamerule worldthreader_CreateNetherPortalsForAllEntities) or the entity is returned to the portal it entered at the end of the gametick it was teleported away. From the client perspective this is seamless, however e.g. a piston may fail to push a mob that just entered a portal and has not yet returned, as the piston pushes before the end of the gametick when the mob returns.

Interdimensional commands in command blocks or shared scoreboard accesses from different dimensions can be observed to be in a different order, since there are no interdimensional ordering guarantees within a single gametick for interdimensional commands. The order of commands within one dimension stays the same as vanilla.

Can my dimensions get de-synchronized?

Worldthreader will always synchronize the dimensions with each other, setting the overall MSPT to the slowest individual dimension.

Are dimension counts above 3 supported?

Yes.

Can I use Worldthreader if I have fewer threads on my CPU than dimensions?

Yes, but that may reduce the performance.

How is the compatibility with other mods?

Compatibility issues with other mods will be very common. Often these issues cannot be fixed by this mod, but instead the other mods have to adjust. The author of Worldthreader is willing to cooperate and suggest changes to other mods for compatibility.

What about older versions of Minecraft?

There is the DimThread mod which supports a few older versions: https://github.com/WearBlackAllDay/DimensionalThreading


License

Worldthreader is licensed under MIT, a free and open-source license. For more information, please read the license file.