im trying to generate trees on beaches but almost everytime it generates in the water
here is the code:
public class FJPlacements {
public static final PlacedFeature PALM_TREE_PLACED = PlacementUtils.register("palm_tree_placement",
FJConfiguredFeatures.PALM.placed(RarityFilter.onAverageOnceEvery(1),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
PlacementUtils.HEIGHTMAP_TOP_SOLID,
BiomeFilter.biome()));
}
@Mod.EventBusSubscriber(modid = FosilizedJourneys.MOD_ID)
public class WorldGenerationEvents {
@SubscribeEvent
public static void biomeLoadingEvent(final BiomeLoadingEvent event) {
ResourceKey<Biome> key = ResourceKey.create(Registry.BIOME_REGISTRY, event.getName());
Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(key);
if (types.contains(BiomeDictionary.Type.BEACH)) {
if (types.contains(BiomeDictionary.Type.SANDY)) {
event.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, FJPlacements.PALM_TREE_PLACED);
}
}
}
}