So, when I implemented ore generation for my mod, everything's working as expected, except, that my tin ore is a lot rarer than I intended. Not big issue, I thought, then proceeded to bump up the value for vein per chunk. To my surprise, that didn't help, no matter how absurd I altered the value to. But in the end of the day, the ore still generated, so I called it a day and continued working on other stuff.
Only today, when I was working on new ores, I discovered that the tin ores are generating in abundance down in y=-40. This made me slowly realise where the issue lie.
public static final Holder<PlacedFeature> TIN_ORE_PLACED = PlacementUtils.register("tin_ore_placed",
ModConfiguredFeatures.TIN_ORE, commonOrePlacement(32,
HeightRangePlacement.triangle(VerticalAnchor.aboveBottom(-16), VerticalAnchor.aboveBottom(94))));
public static final Holder<PlacedFeature> TIN_ORE_LARGE_PLACED = PlacementUtils.register("tin_ore_large_placed",
ModConfiguredFeatures.TIN_ORE_LARGE, commonOrePlacement(16,
HeightRangePlacement.triangle(VerticalAnchor.aboveBottom(-16), VerticalAnchor.aboveBottom(94))));
Here in this section of my ModPlacedFeatured.java, I think I misunderstood the 'VerticalAnchor.aboveBottom' value, I thought it means my ore will only generate between y=-16 to y=94, and will be most commonly found in the y=39 region. However, it is evident that the tin ores are more commonly generated in y=-40 and below, despite the fact they shouldn't be there in the first place.
In an attempt to un-mess up my mess up, I tried to look into what the VerticalAnchor value is for, and did a range of research online. I searched blindly for what I will not find.
This is my final desperate cry for help.
Edit: Changing the aboveBottom to absolute fixed it, huge thanks