Waystones

Waystones

123M Downloads

Generation conflict with Bountiful Mods

MLMII opened this issue ยท 7 comments

commented
  • Forge version: 1.15.2-31.1.25
  • Bountiful version: 3.0.0-1.15.2
  • Waystones version: 1.15.2-6.0.1

When Waystones are set to generate inside of villages; "bounty boards" from bountiful do not generate at all; but when Waystones are not set to generate inside villages, they do. I tested this on two different worlds using the same seed.

This was not the case in the last version of Waystones (where multiple Waystones would sometimes generate); as both Bounty Boards and Waystones were generating properly.

I also posted this issue on the Bountiful issue page.

Thanks,

commented

Next version will also add the piece to the unused weighted list to prevent the scenario described above.

As for the actual issue, I'm not sure if this is really fixable with the way the village generation works. No matter what, unless you're the starting point (for villages, that is the well), since it is based on random generation, there is no guarantee that your structure (be it the waystone, or the bounty board) will spawn exactly once.

That however is unrelated to this issue, so continuing that in #259 and marking this one as "nothing I can do".

commented

This is waiting on a Forge PR to be merged which will bring more control over Village generation. Right now it's best to just not enable village generation of waystones because they simply don't work well yet.

commented

The problem here is that you adds the new JigsawPiece to JigsawPattern#jigsawpieces and not to JigsawPattern#field_214952_d, because no one will check the long list for added items. Therefor the sourcePairs must be edited for other mods to recognize changes. This can be easily be fixed.

If you want i can write a PR.

commented

Can you explain further? Looking at the decompiled code, getRandomPiece only queries jigsawPieces and field_214952_d doesn't seem to be used at all.

commented

First of all field_214952_d contains the source pairs of the Jigsawpieces and their weight. which are used to build jigsawPieces.

Like Bountiful, i my self modify field_214952_d and rebuild jigsawPieces from this list, because searching jigsawPieces for changes is unnecessary if you can have a better way.

List<Pair<JigsawPiece,Integer>> pieces = Lists.newArrayList(houses.field_214952_d); pieces.add(Pair.of(new SingleJigsawPiece(waystoneStructure.toString(), Collections.emptyList(), JigsawPattern.PlacementBehaviour.RIGID), 1)); houses.field_214952_d = ImmutableList.copyOf(pieces); houses.jigsawPieces.add(new SingleJigsawPiece(waystoneStructure.toString(), Collections.emptyList(), JigsawPattern.PlacementBehaviour.RIGID));

with this AT entry
public-f net.minecraft.world.gen.feature.jigsaw.JigsawPattern field_214952_d

would suffice in your case.

commented

Why do other mods care about field_214952_d? I understand it'd be more "correct" to add my piece to that field too, but the effective way of adding new jigsaw pieces right now seems to be by having them added to jigsawPieces.

If anything, I don't see how simply adding something to only jigsawPieces would cause someone else's structure not to be generated (I just assumed it was a probability issue, which MinecraftForge/MinecraftForge#6324 would give us the tools to solve).

commented

Because some mods, Bountiful for example, don't care about changes to jigsawPieces and only takes field_214952_d. And if your mod is loaded before those mods your changes to jigsawPieces are reverted.

Why your structure is generated while theirs not i don't know.

But do what you want