Skip to content

Conversation

@DavixDevelop
Copy link

Pipeline

This PR ports the same addon support system from TerraPlusPlus. This is done by introducing RealWorldGeneratorPipelines, inspired by EarthGeneratorPipelines from T++. Said class calls the events via Bukkit's PluginManager, to which other plugins can listen and add their own custom functionality. These events are the following:

  • InitRealDatasetsEvent for custom datasets
  • InitRealBiomeFilterRegistryEvent for custom biome filters
  • InitRealEarthDataBakerRegistryEvent for custom data bakers
  • InitRealWorldPopulatorRegistryEvent for custom populators

These are then collected, alongside the built-in ones (Like the KoppenBiomeFilter or the legacy Terra121BiomeFilter, depending on the config - biomes.legacy_dataset - both registered under the key biome_filter), and passed to the generator. The generator initialises the T-- pipeline that gets passed to the cache loader ChunkDataLoader used by the single cache in RealWorldGenerator. This eliminates the need for other functionalities, ex, TreePopulator to hold their own chunk data cache and other info that the generator holds.

Keys of other datasets, biome filters, etc, can be seen in RealWorldGeneratorPipelines.

Custom biome provider

The previous biome provider now becomes a proper biome filter and is moved to KoppenBiomeFilter. This enables the new biome filter to receive the chunk data from T-- pipeline and transform the data to bukkit biome via T-- TerraBukkik.

Tree populator

The class TreePopulator gets moved to the package gen.populate.tree (as well as TreeBlock) and extends the new class RealWorldPopulator. To receive the biome at a location via the custom biome provider, it receives the generator via dependency injection. Tree populator is registered under the trees key in the pipeline, same as in T++.

Real-world populator

All block populators must extend the new class RealWorldPopulator. The said class receives the generator via dependency injection, which then gets passed to the new abstracts populate method with the following signature:

populate(@NotNull WorldInfo worldInfo, @NotNull Random random, @NotNull int chunkX, @NotNull int chunkZ, @NotNull int xOffset, @NotNull int zOffset, @NotNull int yOffset, @NotNull LimitedRegion limitedRegion, @NotNull CachedChunkData chunkData, @NotNull RealWorldGenerator worldGenerator)

The abstract method must be implemented, as it gets called by the default BlockPopulator::populate method.

Full changelog:

  • Add Maven plugin: run-paper-maven-plugin, for easier debugging
  • Change to a fork of terraminusminus that enables adding support for add-ons in consuming projects (for now)
  • Change CustomBiomeProvider:
    • Move most of the existing logic to a proper biome filter KoppenBiomeFilter, which gets used in net.buildtheearth.terraminusminus.generator.EarthBiomeProvider
    • Said EarthBiomeProvider populates CachedChunkData, which gets indirectly acquired via RealWorldGenerator::getTerraChunkData and converted to a bukkit biome via net.buildtheearth.terraminusminus.substitutes.TerraBukkit
  • Add RealWorldGeneratorPipelines:
    • All datasets, data bakers (IEarthDataBaker), biome filters (IEarthBiomeFilter), and block populators (RealWorldPopulator) must be first called via Bukkit::getPluginManager::callEvent
    • Datasets must be registered via InitRealDatasetsEvent
    • IEarthDataBaker, IEarthBiomeFilter and RealWorldPopulator must be registered via InitRealEarthRegistryEvent
    • KoppenClimateData should now be included in the GeneratorDatasets
    • RealWorldGeneratorPipelines::biomeFilters should by default return KoppenBiomeFilter or the legacy Terra121BiomeFilter registered on the key "biome_filter"
      depending on the config ("biomes.legacy_dataset" option) and the UserOverrideBiomeFilter, registered under the key "biome_overrides"
  • Change RealWorldGenerator:
    • X and Z offset should be checked to be in multiples of 16
    • Change CachedChunkData to be initialised directly via the returned GeneratorDatasets, IEarthBiomeFilter’s from RealWorldGeneratorPipelines,
      and change TerraMinusMinus:EarthBiomeProvider to be directly initialised via GeneratorDatasets and IEarthBiomeFilter’s (via RealWorldGeneratorPipelines::biomeFilters)
    • Store GeneratorDatasets, EarthBiomeProvider, RealWorldPopulator's (BlockPopulator) and Terraplusminus instance inside RealWorldGenerator
    • Add getTerraChunkDataAsync to return CachedChunkData from the cache async
  • Remove CustomBiomeProvider and port it to TerraPlusMinusBiomeFilter (IEarthBiomeFilter)
  • Add UserOverrideBiomeFilter to enable overriding biomes the same way as in TerraPlusPlus
  • Add RealWorldPopulator (BlockPopulator):
    • Modify the class so that all block populators that wish to use the CachedChunkData from RealWorldGenerator must extend this class and override the second populate method
      instead of the default populate method
    • Modify the default populate method to get the CachedChunkData from RealWorldGenerator, and pass it over alongside other parameters to the second populate method

@DavixDevelop DavixDevelop marked this pull request as draft January 8, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant