SpongePowered / SpongeAPI

A Minecraft plugin API
http://www.spongepowered.org/
MIT License
1.14k stars 342 forks source link

remove structure config api #2420

Closed ImMorpheus closed 2 years ago

ImMorpheus commented 2 years ago

SpongeAPI | Sponge

Zidane commented 2 years ago

@ImMorpheus

How is this handled now?

ImMorpheus commented 2 years ago

@Zidane With the current system (api-9) you add structures by creating a StructureGenerationConfig and adding it to the NoiseGenerationConfig. The NoiseGenerationConfig is then used by the ChunkGenerator

https://github.com/SpongePowered/SpongeAPI/blob/9a481d36ba9c9fee4d63627452c199c68f4b9910/src/main/java/org/spongepowered/api/world/generation/config/structure/StructureGenerationConfig.java#L63-L67

https://github.com/SpongePowered/SpongeAPI/blob/9a481d36ba9c9fee4d63627452c199c68f4b9910/src/main/java/org/spongepowered/api/world/generation/config/NoiseGeneratorConfig.java#L185

https://github.com/SpongePowered/SpongeAPI/blob/9a481d36ba9c9fee4d63627452c199c68f4b9910/src/main/java/org/spongepowered/api/world/generation/ChunkGenerator.java#L37-L51

The ChunkGenerator can be used to generate a world (See WorldTemplate and WorldTest testplugin)

1.18.2 however nuked StructureSettings and decoupled NoiseGenerationConfig from structure generation, added a StructureSet class with a STRUCTURE_SET_REGISTRY and did a complete refactor of structure generation. This PR removes the current api so that we can update to 1.18.2 and rework our current approach.