Quark

Quark

143M Downloads

[1.16.5] VillageConfig size limit 0-7 exceeded by quark:big_dungeon/starts

noobanidus opened this issue ยท 1 comments

commented

As noted, the codec for the VillageConfig has a limit on the size field of 0 and 7.

   public static final Codec<VillageConfig> field_236533_a_ = RecordCodecBuilder.create((p_236535_0_) -> {
      return p_236535_0_.group(JigsawPattern.field_244392_b_.fieldOf("start_pool").forGetter(VillageConfig::func_242810_c), Codec.intRange(0, 7).fieldOf("size").forGetter(VillageConfig::func_236534_a_)).apply(p_236535_0_, VillageConfig::new);
   });

According to Blame, the configured structure can't be turned into JSON because of it:

****************** Blame Report Broken Worldgen 1.16.5-3.3.0-forge ******************

 These ConfiguredStructure were unabled to be turned into JSON which is... bad.
 This is all the info we can get about the ConfiguredStructure

 Error msg is: Value 10 outside of range [0:7]
 Registry Name: null  | Instance: net.minecraft.world.gen.feature.StructureFeature@1cff07ae
 Partial JSON Result: ... [snip, see gist below]
 Biomes Affected: minecraft:plains, ... [snip]

The relevant prettified JSON can be found here.

Most significantly, line 152 has "size": 10 which is where the codec is failing.

TelepathicGrunt suggested that you could make your own codec based on the existing VillageConfig codec but with larger bounds for the size field. This would include creating the new IFeatureConfig (just copying VillageConfig to BigDungeonConfig) and also replacing the JigsawStructure base for BigDungeon with a custom BigDungeonStructure (which could just be a copy of JigsawStructure but extends Structure<BigDungeonConfig>).

From what I can see in the 1.16.5 code base at least, switching from JigsawStructure to a custom BigDungeonStructure would have no overall impact as pretty much everything just looks for descendants of Structure.

If I get time in the next few days to make a PR, I'll give it a try.

commented

Hello! Quark's moved to 1.18 now-- unfortunately, this means that (unless your bug is critical and/or game-breaking), we're closing support for issues filed for versions prior to it (e.g. Quark on 1.16).

If your issue still occurs on 1.18, or if your issue happens to be rather critical (e.g. consistently crashing the game with no other mods present), please leave another note or open a new issue. Thanks for your cooperation!