Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Working ore generation in forge 1.16.3!
- // To get this to work, add this to the constructor of your mod's main class:
- // MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, OreGen::addFeaturesToBiomes).
- public class OreGen {
- public static void addFeaturesToBiomes(BiomeLoadingEvent event) {
- // this will add to every biome in the overworld
- if (!event.getCategory().equals(Biome.Category.NETHER) && !event.getCategory().equals(Biome.Category.THEEND)) {
- addOreToBiome(event.getGeneration(), BlockInit.SMILE_BLOCK.get(), 60, 10, 6, 20);
- }
- }
- private static void addOreToBiome(BiomeGenerationSettingsBuilder biomeGenSettings, Block oreBlock, int maxHeight, int minHeight, int veinSize, int veinsPerChunk){
- // mappings weirdness (if some fields don't exist for you):
- // field_241882_a should be BASE_STONE_OVERWORLD
- // field_242907_l should be RANGE
- ConfiguredFeature<?, ?> feature = Feature.ORE.withConfiguration(
- new OreFeatureConfig(
- OreFeatureConfig.FillerBlockType.field_241882_a,
- oreBlock.getDefaultState(),
- veinSize))
- .withPlacement(Placement.field_242907_l.configure(new TopSolidRangeConfig(minHeight, 0, maxHeight))).func_242731_b(veinsPerChunk);
- biomeGenSettings.getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> feature);
- }
- }
Add Comment
Please, Sign In to add comment