Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.furpuro.mysticrealms.world
- import net.fabricmc.fabric.api.biome.v1.BiomeModifications
- import net.fabricmc.fabric.api.biome.v1.BiomeSelectors
- import net.fabricmc.fabric.api.biome.v1.ModificationPhase
- import net.fabricmc.fabric.impl.biome.modification.BuiltInRegistryKeys
- import net.minecraft.core.Registry
- import net.minecraft.data.BuiltinRegistries
- import net.minecraft.data.worldgen.features.OreFeatures
- import net.minecraft.resources.ResourceKey
- import net.minecraft.server.level.WorldGenRegion
- import net.minecraft.world.level.biome.Biome
- import net.minecraft.world.level.levelgen.GenerationStep
- import net.minecraft.world.level.levelgen.VerticalAnchor
- import net.minecraft.world.level.levelgen.WorldGenSettings
- import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
- import net.minecraft.world.level.levelgen.feature.Feature
- import net.minecraft.world.level.levelgen.feature.OreFeature
- import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration
- import net.minecraft.world.level.levelgen.placement.CountPlacement
- 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 ru.furpuro.mysticrealms.Mysticrealms
- import ru.furpuro.mysticrealms.blocks.ModBlocks
- import ru.hollowhorizon.hc.client.utils.get
- import ru.hollowhorizon.hc.client.utils.rl
- object ModWorldGen {
- private val DEBILIUM_ORE_CONFIGURED_FEATURE:ConfiguredFeature<OreConfiguration,*> = ConfiguredFeature(
- Feature.ORE,
- OreConfiguration(
- listOf(
- OreConfiguration.target(
- OreFeatures.STONE_ORE_REPLACEABLES,
- ModBlocks.DEBILIUM_ORE.get().defaultBlockState(),
- )
- ),
- 4
- )
- )
- private val DEBILIUM_ORE_PLACED_FEATURE: PlacedFeature = PlacedFeature(
- BuiltinRegistries.register(
- BuiltinRegistries.CONFIGURED_FEATURE,
- "${Mysticrealms.MOD_ID}:debilium_ore".rl,
- DEBILIUM_ORE_CONFIGURED_FEATURE
- ),
- listOf(
- CountPlacement.of(4), // Количество жил на чанк
- InSquarePlacement.spread(),
- HeightRangePlacement.uniform(VerticalAnchor.absolute(0), VerticalAnchor.absolute(16))
- )
- )
- private val DEEPSLATE_DEBILIUM_ORE_CONFIGURED_FEATURE:ConfiguredFeature<OreConfiguration,*> = ConfiguredFeature(
- Feature.ORE,
- OreConfiguration(
- listOf(
- OreConfiguration.target(
- OreFeatures.DEEPSLATE_ORE_REPLACEABLES,
- ModBlocks.DEEPSLATE_DEBILIUM_ORE.get().defaultBlockState(),
- )
- ),
- 4
- )
- )
- private val DEEPSLATE_DEBILIUM_ORE_PLACED_FEATURE: PlacedFeature = PlacedFeature(
- BuiltinRegistries.register(
- BuiltinRegistries.CONFIGURED_FEATURE,
- "${Mysticrealms.MOD_ID}:debilium_ore".rl,
- DEEPSLATE_DEBILIUM_ORE_CONFIGURED_FEATURE
- ),
- listOf(
- CountPlacement.of(4), // Количество жил на чанк
- InSquarePlacement.spread(),
- HeightRangePlacement.uniform(VerticalAnchor.absolute(-32), VerticalAnchor.absolute(0))
- )
- )
- fun registerWorldGen() {
- val debiliumOreKey = ResourceKey.create(Registry.PLACED_FEATURE_REGISTRY, "${Mysticrealms.MOD_ID}:debilium_ore".rl)
- Registry.register(
- BuiltinRegistries.PLACED_FEATURE,
- debiliumOreKey.location(),
- DEBILIUM_ORE_PLACED_FEATURE
- )
- BiomeModifications.addFeature(
- BiomeSelectors.all(),
- GenerationStep.Decoration.UNDERGROUND_ORES,
- debiliumOreKey
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement