Search in sources :

Example 1 with PlacedFeature

use of net.minecraft.world.gen.feature.PlacedFeature in project Blockus by Brandcraf06.

the class BlockusConfiguredFeatures method registerConfiguredFeature.

public static void registerConfiguredFeature() {
    // limestone
    RegistryKey<PlacedFeature> oreLimestoneUpper = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "ore_limestone_upper"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, oreLimestoneUpper.getValue(), BlockusOreFeatures.ORE_LIMESTONE.withPlacement(modifiersWithRarity(6, HeightRangePlacementModifier.uniform(YOffset.fixed(64), YOffset.fixed(128)))));
    BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, oreLimestoneUpper);
    RegistryKey<PlacedFeature> oreLimestoneLower = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "ore_limestone_lower"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, oreLimestoneLower.getValue(), BlockusOreFeatures.ORE_LIMESTONE.withPlacement(modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(60)))));
    BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, oreLimestoneLower);
    // marble
    RegistryKey<PlacedFeature> oreMarble = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "ore_marble"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, oreMarble.getValue(), BlockusOreFeatures.ORE_MARBLE.withPlacement(modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(64)))));
    BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, oreMarble);
    // bluestone
    RegistryKey<PlacedFeature> oreBluestone = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "ore_bluestone"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, oreBluestone.getValue(), BlockusOreFeatures.ORE_BLUESTONE.withPlacement(modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(0)))));
    BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, oreBluestone);
    // white oak
    RegistryKey<PlacedFeature> treeWhiteOak = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "white_oak_tree"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, treeWhiteOak.getValue(), BlockusVegetationFeatures.WHITE_OAK_TREE);
    BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.FOREST, BiomeKeys.FLOWER_FOREST), GenerationStep.Feature.VEGETAL_DECORATION, treeWhiteOak);
    RegistryKey<PlacedFeature> treeWhiteOakRare = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "white_oak_tree_rare"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, treeWhiteOakRare.getValue(), BlockusVegetationFeatures.WHITE_OAK_TREE_RARE);
    BiomeModifications.addFeature(BiomeSelectors.categories(Biome.Category.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, treeWhiteOakRare);
    RegistryKey<PlacedFeature> treeWhiteOakChecked = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "white_oak_checked"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, treeWhiteOakChecked.getValue(), BlockusVegetationFeatures.WHITE_OAK_CHECKED);
    // rainbow rose
    RegistryKey<PlacedFeature> rainbowRose = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Blockus.MOD_ID, "rainbow_rose"));
    Registry.register(BuiltinRegistries.PLACED_FEATURE, rainbowRose.getValue(), BlockusVegetationFeatures.RAINBOW_ROSE.withPlacement(SquarePlacementModifier.of(), PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, BiomePlacementModifier.of()));
    BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.FLOWER_FOREST, BiomeKeys.MEADOW), GenerationStep.Feature.VEGETAL_DECORATION, rainbowRose);
}
Also used : Identifier(net.minecraft.util.Identifier) PlacedFeature(net.minecraft.world.gen.feature.PlacedFeature)

Example 2 with PlacedFeature

use of net.minecraft.world.gen.feature.PlacedFeature in project Terracraft by SimplyCmd.

the class FeatureRegistry method registerSimplePlant.

public static Tuple registerSimplePlant(SimpleBlock block, int rarity, int tries, int xz_spread, int y_spread, Predicate<BiomeSelectionContext> biomeSelector) {
    final String id = block.getId().getPath();
    final ConfiguredFeature<RandomPatchFeatureConfig, ?> plantCF = registerCF(id + "_cf", Feature.FLOWER.configure(new RandomPatchFeatureConfig(tries, xz_spread, y_spread, () -> {
        return Feature.SIMPLE_BLOCK.configure(new SimpleBlockFeatureConfig(BlockStateProvider.of(block.getBlock().getDefaultState()))).withInAirFilter();
    })));
    final PlacedFeature plantPF = registerPF(id + "_pf", plantCF.withPlacement(new PlacementModifier[] { RarityFilterPlacementModifier.of(rarity), SquarePlacementModifier.of(), PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, BiomePlacementModifier.of() }));
    final RegistryKey<PlacedFeature> plantK = RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Main.MOD_ID, id + "_pf"));
    BiomeModifications.addFeature(BiomeSelectors.all(), GenerationStep.Feature.VEGETAL_DECORATION, plantK);
    return new Tuple(plantCF, plantPF, plantK);
}
Also used : Identifier(net.minecraft.util.Identifier) RandomPatchFeatureConfig(net.minecraft.world.gen.feature.RandomPatchFeatureConfig) SimpleBlockFeatureConfig(net.minecraft.world.gen.feature.SimpleBlockFeatureConfig) PlacedFeature(net.minecraft.world.gen.feature.PlacedFeature) Tuple(io.github.simplycmd.terracraft.Tuple)

Example 3 with PlacedFeature

use of net.minecraft.world.gen.feature.PlacedFeature in project Terracraft by SimplyCmd.

the class FeatureRegistry method register.

public static void register() {
    final Tuple daybloom = registerSimplePlant(BlockRegistry.daybloom, 22, 64, 3, 2, BiomeSelectors.all());
    daybloomCF = (ConfiguredFeature<RandomPatchFeatureConfig, ?>) daybloom.get(0);
    daybloomPF = (PlacedFeature) daybloom.get(1);
    daybloomK = (RegistryKey<PlacedFeature>) daybloom.get(2);
    final Tuple blueBerryBush = registerSimplePlant(BlockRegistry.blue_berry_bush, 32, 64, 1, 2, BiomeSelectors.all());
    blueBerryBushCF = (ConfiguredFeature<RandomPatchFeatureConfig, ?>) blueBerryBush.get(0);
    blueBerryBushPF = (PlacedFeature) blueBerryBush.get(1);
    blueBerryBushK = (RegistryKey<PlacedFeature>) blueBerryBush.get(2);
}
Also used : RandomPatchFeatureConfig(net.minecraft.world.gen.feature.RandomPatchFeatureConfig) PlacedFeature(net.minecraft.world.gen.feature.PlacedFeature) Tuple(io.github.simplycmd.terracraft.Tuple)

Aggregations

PlacedFeature (net.minecraft.world.gen.feature.PlacedFeature)3 Tuple (io.github.simplycmd.terracraft.Tuple)2 Identifier (net.minecraft.util.Identifier)2 RandomPatchFeatureConfig (net.minecraft.world.gen.feature.RandomPatchFeatureConfig)2 SimpleBlockFeatureConfig (net.minecraft.world.gen.feature.SimpleBlockFeatureConfig)1