Litematica (Forge)

Litematica (Forge)

336k Downloads

Custom servers without vanilla `overworld` can cause crashes

VidTu opened this issue ยท 0 comments

commented

Commit 13d457a fixed the mod compatibility, but it also can lead to crashes.

The line

RegistryEntry<DimensionType> entry = lookup.getOrThrow(RegistryKeys.DIMENSION_TYPE).getOrThrow(DimensionTypes.OVERWORLD);

expects the minecraft:overworld to be there, but custom servers may send dimension registries (via Join Packet) without minecraft:overworld and vanilla clients will work just fine, but litematica will crash with the following (example) crash stacktrace:

java.lang.IllegalStateException: Missing element ResourceKey[minecraft:dimension_type / minecraft:overworld]
	at net.minecraft.class_7871.method_46748(class_7871.java:15) ~[client-intermediary.jar:?]
	at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
	at net.minecraft.class_7871.method_46747(class_7871.java:15) ~[client-intermediary.jar:?]
	at fi.dy.masa.litematica.world.SchematicWorldHandler.createSchematicWorld(SchematicWorldHandler.java:61) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.world.SchematicWorldHandler.getWorld(SchematicWorldHandler.java:45) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.world.SchematicWorldHandler.getSchematicWorld(SchematicWorldHandler.java:37) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.util.RayTraceUtils.traceToSchematicWorld(RayTraceUtils.java:339) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.util.RayTraceUtils.getGenericTrace(RayTraceUtils.java:366) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.render.OverlayRenderer.renderHoverInfo(OverlayRenderer.java:460) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.litematica.event.RenderHandler.onRenderGameOverlayPost(RenderHandler.java:52) ~[litematica-fabric-1.19.4-0.14.3.jar:?]
	at fi.dy.masa.malilib.event.RenderEventHandler.onRenderGameOverlayPost(RenderEventHandler.java:68) ~[malilib-fabric-1.19.4-0.15.3.jar:?]

Minecraft: 1.19.4
Litematica: litematica-fabric-1.19.4-0.14.3
MaliLib: malilib-fabric-1.19.4-0.15.3