Tangled handlers

- Fixed server-side ticking code called from the render thread with forge 40.2.1 and up
This commit is contained in:
simibubi 2023-01-29 16:49:01 +01:00
parent 52593a2ae9
commit 8cf282372c
2 changed files with 5 additions and 2 deletions

View file

@ -8,7 +8,7 @@ mod_version = 0.5.0.i
artifact_minecraft_version = 1.18.2
minecraft_version = 1.18.2
forge_version = 40.1.60
forge_version = 40.2.1
# build dependency versions
forgegradle_version = 5.1.53

View file

@ -60,6 +60,7 @@ import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.LogicalSide;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.forgespi.language.IModFileInfo;
@ -120,9 +121,11 @@ public class CommonEvents {
}
@SubscribeEvent
public static void onWorldTick(WorldTickEvent event) {
public static void onServerWorldTick(WorldTickEvent event) {
if (event.phase == Phase.START)
return;
if (event.side == LogicalSide.CLIENT)
return;
Level world = event.world;
ContraptionHandler.tick(world);
CapabilityMinecartController.tick(world);