Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fabric server fails to load when Terra config packs are referenced in a world preset #479

Open
6 tasks done
unilock opened this issue Nov 2, 2024 · 0 comments
Open
6 tasks done
Labels
Platform: Fabric Issue/PR is applicable to the Fabric platform. Status: Needs further testing Issue requires further investigation Type: Bug Something isn't working as intended.

Comments

@unilock
Copy link

unilock commented Nov 2, 2024

Pre-Issue Checklist

  • I have checked that I am on the latest version of Terra.
  • I have searched the github issue tracker for similar issues, including
    closed ones.
  • I have made sure that this is not a bug with another mod or plugin, and it
    is Terra that is causing the issue.
  • I have checked that this is an issue with Terra and not an issue with the
    pack I am using.
  • I have attached a copy of the latest.log file
  • I have filled out and provided all the appropriate information.

Environment

Name Value
Terra Version 6.5.0-BETA+b7326c0ff
Platform / Platform Version Minecraft 1.21.1, Fabric Loader 0.16.9, Fabric API 0.107.0+1.21.1
Any External Plugins or Mods N/A
Terra Packs In Use only the default overworld pack
Terra Addons In Use only the default addons

Issue Description

When creating a new world using a world_preset (a.k.a. level-type) that references Terra config packs directly (instead of using a Terra world preset, such as terra:overworld/overworld), the game crashes during registry loading and datapack parsing due to a "No such config pack" error. (it does not matter which config pack is used)

Steps to reproduce

  1. Create a new Minecraft 1.21.1 server with Fabric Loader
  2. Install Terra
  3. Prior to starting the server, create the world directory, and a datapacks directory within that
  4. Add this repository (as a ZIP file) to that datapacks directory: https://github.com/unilock/terra-issue-datapack
  5. Start the server

Expected behavior

The server uses the Terra config pack specified by the data pack to generate the overworld

Actual behavior

The server crashes

Full stacktrace

Exception Stacktrace
[20:23:56] [main/ERROR]: Registry loading errors:
> Errors in registry minecraft:worldgen/world_preset:
>> Errors in element minecraft:normal:
java.lang.IllegalStateException: Failed to parse minecraft:worldgen/world_preset/normal.json from pack file/example
	at knot//net.minecraft.class_7655.method_45122(class_7655.java:251)
	at knot//net.minecraft.class_7655$class_9158.method_56520(class_7655.java:96)
	at knot//net.minecraft.class_7655.method_56514(class_7655.java:151)
	at knot//net.minecraft.class_7655.method_45120(class_7655.java:164)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at knot//net.minecraft.class_7655.method_45121(class_7655.java:164)
	at knot//net.minecraft.class_7655.mixinextras$bridge$method_45121$36(class_7655.java)
	at knot//net.minecraft.class_7655.wrapOperation$zgk000$fabric-registry-sync-v0$wrapIsServerCall(class_7655.java:1056)
	at knot//net.minecraft.class_7655.mixinextras$bridge$wrapOperation$zgk000$fabric-registry-sync-v0$wrapIsServerCall$39(class_7655.java)
	at knot//net.minecraft.class_7655.wrapOperation$zha000$fabric-resource-conditions-api-v1$captureRegistries(class_7655.java:1557)
	at knot//net.minecraft.class_7655.method_56515(class_7655.java:151)
	at knot//net.minecraft.class_7237.method_45142(class_7237.java:62)
	at knot//net.minecraft.class_7237.method_45143(class_7237.java:66)
	at knot//net.minecraft.class_7237.method_42098(class_7237.java:32)
	at knot//net.minecraft.server.Main.method_43612(Main.java:184)
	at knot//net.minecraft.class_156.method_43498(class_156.java:1018)
	at knot//net.minecraft.class_156.method_43499(class_156.java:1012)
	at knot//net.minecraft.server.Main.main(Main.java:182)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)
	at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)
Caused by: java.lang.IllegalArgumentException: No such config pack OVERWORLD:OVERWORLD
	at knot//com.dfsek.terra.mod.data.Codecs.lambda$static$1(Codecs.java:32)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at knot//com.dfsek.terra.mod.data.Codecs.lambda$static$2(Codecs.java:32)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$1.lambda$decode$0(RecordCodecBuilder.java:185)
	at knot//com.mojang.serialization.DataResult$Success.map(DataResult.java:175)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$1.lambda$decode$1(RecordCodecBuilder.java:184)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$1.decode(RecordCodecBuilder.java:183)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
	at knot//com.mojang.serialization.MapDecoder.lambda$compressedDecode$1(MapDecoder.java:52)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
	at knot//com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:158)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
	at knot//com.mojang.serialization.MapCodec$2.decode(MapCodec.java:77)
	at knot//com.mojang.serialization.MapCodec$3.decode(MapCodec.java:140)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$1.decode(RecordCodecBuilder.java:183)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
	at knot//com.mojang.serialization.MapDecoder.lambda$compressedDecode$1(MapDecoder.java:52)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
	at knot//com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:158)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
	at knot//com.mojang.serialization.MapCodec$2.decode(MapCodec.java:77)
	at knot//com.mojang.serialization.MapCodec$3.decode(MapCodec.java:140)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$5.decode(RecordCodecBuilder.java:323)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
	at knot//com.mojang.serialization.codecs.KeyDispatchCodec.lambda$decode$3(KeyDispatchCodec.java:54)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.codecs.KeyDispatchCodec.lambda$decode$4(KeyDispatchCodec.java:46)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.codecs.KeyDispatchCodec.decode(KeyDispatchCodec.java:45)
	at knot//com.mojang.serialization.MapDecoder.lambda$compressedDecode$1(MapDecoder.java:52)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
	at knot//com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:158)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
	at knot//com.mojang.serialization.MapCodec$2.decode(MapCodec.java:77)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$3.decode(RecordCodecBuilder.java:249)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
	at knot//com.mojang.serialization.MapDecoder.lambda$compressedDecode$1(MapDecoder.java:52)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
	at knot//com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:158)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//com.mojang.serialization.codecs.BaseMapCodec.lambda$decode$3(BaseMapCodec.java:34)
	at java.base/java.util.stream.ReduceOps$1ReducingSink.accept(ReduceOps.java:80)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:667)
	at knot//com.mojang.serialization.codecs.BaseMapCodec.decode(BaseMapCodec.java:30)
	at knot//com.mojang.serialization.codecs.UnboundedMapCodec.lambda$decode$0(UnboundedMapCodec.java:22)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.codecs.UnboundedMapCodec.decode(UnboundedMapCodec.java:22)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
	at knot//com.mojang.serialization.MapCodec$2.decode(MapCodec.java:77)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$Instance$1.decode(RecordCodecBuilder.java:183)
	at knot//com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
	at knot//com.mojang.serialization.MapDecoder.lambda$compressedDecode$1(MapDecoder.java:52)
	at knot//com.mojang.serialization.DataResult$Success.flatMap(DataResult.java:201)
	at knot//com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
	at knot//com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:158)
	at knot//com.mojang.serialization.Decoder$1.decode(Decoder.java:49)
	at knot//com.mojang.serialization.Codec$2.decode(Codec.java:75)
	at knot//com.mojang.serialization.Decoder.parse(Decoder.java:18)
	at knot//net.minecraft.class_7655.method_56915(class_7655.java:230)
	at knot//net.minecraft.class_7655.method_45122(class_7655.java:249)
	... 21 more

[20:23:56] [main/WARN]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load registries due to above errors
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
	at knot/net.minecraft.server.Main.main(Main.java:229) [server-intermediary.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480) [fabric-loader-0.16.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.16.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.16.9.jar:?]
	at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.16.9.jar:?]
Caused by: java.lang.IllegalStateException: Failed to load registries due to above errors
	at knot/net.minecraft.class_7655.method_45121(class_7655.java:181) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7655.mixinextras$bridge$method_45121$36(class_7655.java) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7655.wrapOperation$zgk000$fabric-registry-sync-v0$wrapIsServerCall(class_7655.java:1056) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7655.mixinextras$bridge$wrapOperation$zgk000$fabric-registry-sync-v0$wrapIsServerCall$39(class_7655.java) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7655.wrapOperation$zha000$fabric-resource-conditions-api-v1$captureRegistries(class_7655.java:1557) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7655.method_56515(class_7655.java:151) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7237.method_45142(class_7237.java:62) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7237.method_45143(class_7237.java:66) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_7237.method_42098(class_7237.java:32) ~[server-intermediary.jar:?]
	at knot/net.minecraft.server.Main.method_43612(Main.java:184) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_156.method_43498(class_156.java:1018) ~[server-intermediary.jar:?]
	at knot/net.minecraft.class_156.method_43499(class_156.java:1012) ~[server-intermediary.jar:?]
	at knot/net.minecraft.server.Main.main(Main.java:182) ~[server-intermediary.jar:?]
	... 4 more

Additional details

Using a custom world_preset appears to be the only way to specify a separate Terra config pack for each dimension on Fabric...

latest.log: https://gist.github.com/unilock/217569a4463d4baa20528c6130bffa49

@unilock unilock added Status: Pending Issue/PR is currently awaiting approval by a moderator. Type: Bug Something isn't working as intended. labels Nov 2, 2024
@astrsh astrsh added Platform: Fabric Issue/PR is applicable to the Fabric platform. Status: Needs further testing Issue requires further investigation and removed Status: Pending Issue/PR is currently awaiting approval by a moderator. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Fabric Issue/PR is applicable to the Fabric platform. Status: Needs further testing Issue requires further investigation Type: Bug Something isn't working as intended.
Projects
None yet
Development

No branches or pull requests

2 participants