YUNG-GANG / YUNGs-Better-Dungeons

Minecraft mod that adds actual dungeons to the game
GNU Lesser General Public License v3.0
30 stars 11 forks source link

Compatibility with ChunkByChunk #31

Closed immortius closed 2 years ago

immortius commented 2 years ago

Reported on my end (as developer of ChunkByChunk) with https://github.com/immortius/chunkbychunk/issues/1

Reproduced running:

Error when creating a world:

java.lang.IllegalArgumentException: Multiple entries with same key: com.yungnickyoung.minecraft.betterdungeons.world.structure.small_dungeon.SmallDungeonStructure@54567b05={net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature@2e6b379c=[ResourceKey[minecraft:worldgen/biome / minecraft:mushroom_fields], ResourceKey[minecraft:worldgen/biome / minecraft:the_void], ResourceKey[minecraft:worldgen/biome / minecraft:swamp], ResourceKey[minecraft:worldgen/biome / minecraft:birch_forest], ResourceKey[minecraft:worldgen/biome / minecraft:lush_caves], ResourceKey[minecraft:worldgen/biome / minecraft:ice_spikes], ResourceKey[minecraft:worldgen/biome / minecraft:end_highlands], ResourceKey[minecraft:worldgen/biome / minecraft:sunflower_plains], ResourceKey[minecraft:worldgen/biome / minecraft:stony_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:meadow], ResourceKey[minecraft:worldgen/biome / minecraft:grove], ResourceKey[minecraft:worldgen/biome / minecraft:forest], ResourceKey[minecraft:worldgen/biome / minecraft:nether_wastes], ResourceKey[minecraft:worldgen/biome / minecraft:end_midlands], ResourceKey[minecraft:worldgen/biome / minecraft:plains], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_forest], ResourceKey[minecraft:worldgen/biome / minecraft:small_end_islands], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_spruce_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:taiga], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_slopes], ResourceKey[minecraft:worldgen/biome / minecraft:crimson_forest], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_gravelly_hills], ResourceKey[minecraft:worldgen/biome / minecraft:dripstone_caves], ResourceKey[minecraft:worldgen/biome / minecraft:dark_forest], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_plains], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_hills], ResourceKey[minecraft:worldgen/biome / minecraft:soul_sand_valley], ResourceKey[minecraft:worldgen/biome / minecraft:desert], ResourceKey[minecraft:worldgen/biome / minecraft:savanna], ResourceKey[minecraft:worldgen/biome / minecraft:eroded_badlands], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:frozen_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:flower_forest], ResourceKey[minecraft:worldgen/biome / minecraft:stony_shore], ResourceKey[minecraft:worldgen/biome / minecraft:the_end], ResourceKey[minecraft:worldgen/biome / minecraft:wooded_badlands], ResourceKey[minecraft:worldgen/biome / minecraft:jagged_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_birch_forest], ResourceKey[minecraft:worldgen/biome / minecraft:sparse_jungle], ResourceKey[minecraft:worldgen/biome / minecraft:end_barrens], ResourceKey[minecraft:worldgen/biome / minecraft:jungle], ResourceKey[minecraft:worldgen/biome / minecraft:badlands], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_pine_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:warped_forest], ResourceKey[minecraft:worldgen/biome / minecraft:basalt_deltas], ResourceKey[minecraft:worldgen/biome / minecraft:savanna_plateau], ResourceKey[minecraft:worldgen/biome / minecraft:bamboo_jungle], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_savanna]]} and com.yungnickyoung.minecraft.betterdungeons.world.structure.small_dungeon.SmallDungeonStructure@54567b05={net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature@2e6b379c=[ResourceKey[minecraft:worldgen/biome / minecraft:mushroom_fields], ResourceKey[minecraft:worldgen/biome / minecraft:the_void], ResourceKey[minecraft:worldgen/biome / minecraft:swamp], ResourceKey[minecraft:worldgen/biome / minecraft:birch_forest], ResourceKey[minecraft:worldgen/biome / minecraft:lush_caves], ResourceKey[minecraft:worldgen/biome / minecraft:ice_spikes], ResourceKey[minecraft:worldgen/biome / minecraft:end_highlands], ResourceKey[minecraft:worldgen/biome / minecraft:sunflower_plains], ResourceKey[minecraft:worldgen/biome / minecraft:stony_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:meadow], ResourceKey[minecraft:worldgen/biome / minecraft:grove], ResourceKey[minecraft:worldgen/biome / minecraft:forest], ResourceKey[minecraft:worldgen/biome / minecraft:nether_wastes], ResourceKey[minecraft:worldgen/biome / minecraft:end_midlands], ResourceKey[minecraft:worldgen/biome / minecraft:plains], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_forest], ResourceKey[minecraft:worldgen/biome / minecraft:small_end_islands], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_spruce_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:taiga], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_slopes], ResourceKey[minecraft:worldgen/biome / minecraft:crimson_forest], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_gravelly_hills], ResourceKey[minecraft:worldgen/biome / minecraft:dripstone_caves], ResourceKey[minecraft:worldgen/biome / minecraft:dark_forest], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_plains], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_hills], ResourceKey[minecraft:worldgen/biome / minecraft:soul_sand_valley], ResourceKey[minecraft:worldgen/biome / minecraft:desert], ResourceKey[minecraft:worldgen/biome / minecraft:savanna], ResourceKey[minecraft:worldgen/biome / minecraft:eroded_badlands], ResourceKey[minecraft:worldgen/biome / minecraft:snowy_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:frozen_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:flower_forest], ResourceKey[minecraft:worldgen/biome / minecraft:stony_shore], ResourceKey[minecraft:worldgen/biome / minecraft:the_end], ResourceKey[minecraft:worldgen/biome / minecraft:wooded_badlands], ResourceKey[minecraft:worldgen/biome / minecraft:jagged_peaks], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_birch_forest], ResourceKey[minecraft:worldgen/biome / minecraft:sparse_jungle], ResourceKey[minecraft:worldgen/biome / minecraft:end_barrens], ResourceKey[minecraft:worldgen/biome / minecraft:jungle], ResourceKey[minecraft:worldgen/biome / minecraft:badlands], ResourceKey[minecraft:worldgen/biome / minecraft:old_growth_pine_taiga], ResourceKey[minecraft:worldgen/biome / minecraft:warped_forest], ResourceKey[minecraft:worldgen/biome / minecraft:basalt_deltas], ResourceKey[minecraft:worldgen/biome / minecraft:savanna_plateau], ResourceKey[minecraft:worldgen/biome / minecraft:bamboo_jungle], ResourceKey[minecraft:worldgen/biome / minecraft:windswept_savanna]]}
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:376)
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:370)
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:153)
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:115)
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.ImmutableMap$Builder.buildOrThrow(ImmutableMap.java:574)
    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:538)
    at TRANSFORMER/betterdungeons@1.18.1-1.0.1/com.yungnickyoung.minecraft.betterdungeons.init.BDModStructureFeatures.addStructureToBiomes(BDModStructureFeatures.java:204)
    at TRANSFORMER/betterdungeons@1.18.1-1.0.1/com.yungnickyoung.minecraft.betterdungeons.init.BDModStructureFeatures.addStructuresToBiomesAndDimensions(BDModStructureFeatures.java:157)
    at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247)
    at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239)
    at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
    at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
    at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_129815_(MinecraftServer.java:395)
    at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:313)
    at TRANSFORMER/minecraft@1.18.1/net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:66)
    at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:644)
    at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258)
    at java.base/java.lang.Thread.run(Thread.java:833)

For context, Chunk By Chunk on start of a new world will shunt the overworld dimension configuration into a new dimension and then replace the overworld dimension with a new ChunkGenerator implementation wrapping the original - source. I think this issues occurs because on my end the same ChunkGenerator.settings object is shared across both generators... at least initially, after save/load they would be split. Then better dungeons attempts to inject into both, and hits this error on the second one.

I'll look to see if I can find a clean way to duplicate the settings or parent generator on my end. Likely already fixed in Better Dungeons for 1.18.2 though, with its structure data files.

yungnickyoung commented 2 years ago

Reported as fixed in the linked issue.