javaminecraftminecraft-forgeforge

Can't get trees to generate properly in my mod 1.16.5


I keep trying to generate my custom trees but they only seem to spawn on the corners of chunks and I can't seem to decrease or increase the number spawning beyond them spawning nowhere and them spawning everywhere (within specified biomes on the corners of chunks)

I've tried

.decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(1, 0.25f, 1))));
.decorated(Placement.CHANCE.configured(new ChanceConfig(1))));
.decorated(Placement.COUNT_NOISE.configured(new NoiseDependant(2.0, 2,2 ))));

all three of these methods but they all seem to work the same. This is my class

public class ModTreeGeneration {
    public static void generateTrees(final BiomeLoadingEvent event){

        RegistryKey<Biome> key = RegistryKey.create(Registry.BIOME_REGISTRY, event.getName());
        Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(key);

        if(types.contains(BiomeDictionary.Type.PLAINS)){
            List<Supplier<ConfiguredFeature<?, ?>>> base =
                    event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION);

            base.add(() -> ModConfiguredFeatures.MAGICWOOD.decorated(Features.Placements.HEIGHTMAP)
                .decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(1, 0.25f, 1))));

I expected any change at all when I messed with the values and the only one I got was when I set .decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(0, 0f, 0)))); to 0 it didn't generate any trees but no other value seems to change the generation.


Solution

  • I got it working! Apparently base.add(() -> ModConfiguredFeatures.MAGICWOOD.decorated(Features.Placements.HEIGHTMAP) was making them only spawn on chunk corners by switching HEIGHTMAP to HEIGHTMAP_SQUARE it worked. No idea why