diff --git a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxBiomeModifiers.java b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxBiomeModifiers.java index 749f20844..33b734e29 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxBiomeModifiers.java +++ b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxBiomeModifiers.java @@ -29,6 +29,7 @@ public class ReduxBiomeModifiers { public static final ResourceKey ADD_CLOUDBED = createKey("add_cloudbed"); public static final ResourceKey SKY_COLOR_AETHER = createKey("modify_sky_color"); public static final ResourceKey MUSIC_MODIFY = createKey("modify_music"); + public static final ResourceKey ADD_SENTRITE = createKey("add_sentrite"); private static ResourceKey createKey(String name) { return ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Redux.loc(name)); @@ -53,5 +54,11 @@ public static void bootstrap(BootstapContext context) { // TODO: MusicPredicate, with optional fields for each field of the Music class context.register(MUSIC_MODIFY, new MusicModifier(biomes.getOrThrow(ReduxTags.Biomes.MODIFY_MUSIC), Optional.empty(), Optional.of(CodecPredicates.DualInt.of(ReduxMusic.MUSIC_MIN, ReduxMusic.MUSIC_MAX)), Optional.of(false), Optional.empty(), Optional.empty(), Optional.empty())); - } + + context.register(ADD_SENTRITE, new BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(ReduxTags.Biomes.HAS_SENTRITE), HolderSet.direct(features.getOrThrow(ReduxPlacements.SENTRITE_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)); + + + } } diff --git a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java index 7c292baaa..0ec936bfb 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java +++ b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java @@ -1,5 +1,6 @@ package net.zepalesque.redux.data.resource.registries; +import com.aetherteam.aether.AetherTags; import com.aetherteam.aether.block.AetherBlockStateProperties; import com.aetherteam.aether.data.resources.AetherFeatureStates; import com.aetherteam.aether.data.resources.registries.AetherConfiguredFeatures; @@ -22,6 +23,7 @@ import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; +import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; import net.minecraft.world.level.levelgen.feature.featuresize.TwoLayersFeatureSize; @@ -29,10 +31,12 @@ import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; import net.minecraft.world.level.levelgen.feature.stateproviders.WeightedStateProvider; import net.minecraft.world.level.levelgen.feature.trunkplacers.StraightTrunkPlacer; +import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; import net.neoforged.neoforge.registries.DeferredHolder; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; import net.zepalesque.redux.block.state.ReduxStates; +import net.zepalesque.redux.blockset.stone.ReduxStoneSets; import net.zepalesque.redux.blockset.wood.ReduxWoodSets; import net.zepalesque.redux.data.resource.builders.ReduxFeatureBuilders; import net.zepalesque.redux.world.feature.gen.CloudbedFeature; @@ -47,6 +51,9 @@ public class ReduxFeatureConfig extends ReduxFeatureBuilders { public static final ResourceKey> CLOUDROOT_TREE = createKey("cloudroot"); + public static final ResourceKey> SENTRITE_ORE = createKey(name(ReduxStoneSets.SENTRITE.block()) + "_ore"); + + // Overrides public static final ResourceKey> GRASS_BONEMEAL = createKey("aether_grass_bonemeal"); public static final ResourceKey> GRASS_PATCH = AetherConfiguredFeatures.GRASS_PATCH_CONFIGURATION; @@ -82,6 +89,9 @@ public static void bootstrap(BootstapContext> context) { new TwoLayersFeatureSize(1, 0, 1) ).ignoreVines().build()); + register(context, SENTRITE_ORE, Feature.ORE, new OreConfiguration(new TagMatchTest(AetherTags.Blocks.HOLYSTONE), + drops(ReduxStoneSets.SENTRITE.block()), 48, 0.0F)); + // Overrides register(context, GRASS_PATCH, Feature.RANDOM_PATCH, patch(32, 7, 3, prov(ReduxBlocks.SHORT_AETHER_GRASS), NOT_ON_COARSE_DIRT)); diff --git a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java index 392240fe0..1d00650c2 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java +++ b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java @@ -9,7 +9,12 @@ import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; +import net.minecraft.world.level.levelgen.heightproviders.TrapezoidHeight; +import net.minecraft.world.level.levelgen.placement.BiomeFilter; +import net.minecraft.world.level.levelgen.placement.HeightRangePlacement; +import net.minecraft.world.level.levelgen.placement.InSquarePlacement; import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacementModifier; import net.neoforged.neoforge.registries.DeferredHolder; @@ -20,6 +25,7 @@ public class ReduxPlacements { public static final ResourceKey CLOUDBED = copyKey(ReduxFeatureConfig.CLOUDBED); + public static final ResourceKey SENTRITE_ORE = copyKey(ReduxFeatureConfig.SENTRITE_ORE); public static final ResourceKey BONEMEAL_OVERRIDE = AetherPlacedFeatures.AETHER_GRASS_BONEMEAL; @@ -28,6 +34,11 @@ public static void bootstrap(BootstapContext context) { HolderGetter> configs = context.lookup(Registries.CONFIGURED_FEATURE); register(context, CLOUDBED, configs.getOrThrow(ReduxFeatureConfig.CLOUDBED)); + register(context, SENTRITE_ORE, configs.getOrThrow(ReduxFeatureConfig.SENTRITE_ORE), + InSquarePlacement.spread(), + HeightRangePlacement.of(TrapezoidHeight.of(VerticalAnchor.BOTTOM, VerticalAnchor.aboveBottom(128))), + BiomeFilter.biome() + ); // Overrides register(context, BONEMEAL_OVERRIDE, configs.getOrThrow(ReduxFeatureConfig.GRASS_BONEMEAL), PlacementUtils.isEmpty());