cyan rose bushes?
This commit is contained in:
parent
d5ef637aa7
commit
9649d204e5
4 changed files with 27 additions and 59 deletions
|
@ -1,28 +0,0 @@
|
||||||
package observer.nelle.roses.world;
|
|
||||||
|
|
||||||
// Configured Feature (flowers, how does this look like) -> Placed Feature (How is this feature placed) -> WorldGen/BiomeMod (Where is our feature placed)
|
|
||||||
|
|
||||||
import net.minecraft.registry.Registerable;
|
|
||||||
import net.minecraft.registry.RegistryKey;
|
|
||||||
import net.minecraft.registry.RegistryKeys;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
|
||||||
import net.minecraft.world.gen.feature.FeatureConfig;
|
|
||||||
import observer.nelle.roses.RosesModKt;
|
|
||||||
|
|
||||||
public class RosesConfiguredFeatures {
|
|
||||||
public static void bootstrap(Registerable<ConfiguredFeature<?, ?>> context) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
|
||||||
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(RosesModKt.MOD_ID, name));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <FC extends FeatureConfig, F extends Feature<FC>> void register(Registerable<ConfiguredFeature<?, ?>> context,
|
|
||||||
RegistryKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) {
|
|
||||||
context.register(key, new ConfiguredFeature<>(feature, configuration));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,20 +5,28 @@ import net.minecraft.registry.RegistryKey;
|
||||||
import net.minecraft.registry.RegistryKeys;
|
import net.minecraft.registry.RegistryKeys;
|
||||||
import net.minecraft.registry.entry.RegistryEntry;
|
import net.minecraft.registry.entry.RegistryEntry;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
import net.minecraft.util.math.intprovider.ClampedIntProvider;
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||||
import net.minecraft.world.gen.feature.FeatureConfig;
|
import net.minecraft.world.gen.feature.*;
|
||||||
import net.minecraft.world.gen.feature.PlacedFeature;
|
|
||||||
import net.minecraft.world.gen.placementmodifier.PlacementModifier;
|
import net.minecraft.world.gen.placementmodifier.PlacementModifier;
|
||||||
|
import net.minecraft.world.gen.placementmodifier.*;
|
||||||
import observer.nelle.roses.RosesModKt;
|
import observer.nelle.roses.RosesModKt;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class RosesPlacedFeatures {
|
public class RosesPlacedFeatures {
|
||||||
|
public static final RegistryKey<PlacedFeature> cyanRoseBushPlacedKey = registerKey("cyan_rose_bush_placed");
|
||||||
|
|
||||||
public static void bootstrap(Registerable<PlacedFeature> context) {
|
public static void bootstrap(Registerable<PlacedFeature> context) {
|
||||||
var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE);
|
var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE);
|
||||||
|
|
||||||
|
// pretty much exactly as FOREST_FLOWERS
|
||||||
|
register(context, cyanRoseBushPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseBushKey),
|
||||||
|
RarityFilterPlacementModifier.of(7),
|
||||||
|
SquarePlacementModifier.of(),
|
||||||
|
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||||
|
CountPlacementModifier.of(ClampedIntProvider.create(UniformIntProvider.create(-1, 3), 0, 3)),
|
||||||
|
BiomePlacementModifier.of());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RegistryKey<PlacedFeature> registerKey(String name) {
|
public static RegistryKey<PlacedFeature> registerKey(String name) {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package observer.nelle.roses.world.gen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||||
|
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
|
||||||
|
import net.minecraft.world.biome.BiomeKeys;
|
||||||
|
import net.minecraft.world.gen.GenerationStep;
|
||||||
|
import observer.nelle.roses.world.RosesPlacedFeatures;
|
||||||
|
|
||||||
|
public class RosesVegetationGeneration {
|
||||||
|
public static void generateVegetation() {
|
||||||
|
BiomeModifications.addFeature(BiomeSelectors.includeByKey(
|
||||||
|
BiomeKeys.PLAINS, BiomeKeys.FOREST, BiomeKeys.FLOWER_FOREST, BiomeKeys.BIRCH_FOREST, BiomeKeys.OLD_GROWTH_BIRCH_FOREST, BiomeKeys.DARK_FOREST),
|
||||||
|
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.cyanRoseBushPlacedKey);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,27 +0,0 @@
|
||||||
package observer.nelle.roses
|
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer
|
|
||||||
import observer.nelle.roses.world.gen.RosesWorldGeneration
|
|
||||||
import org.slf4j.Logger
|
|
||||||
import org.slf4j.LoggerFactory
|
|
||||||
|
|
||||||
val LOGGER: Logger = LoggerFactory.getLogger("roses")
|
|
||||||
const val MOD_ID = "roses_mod"
|
|
||||||
|
|
||||||
class Roses : ModInitializer {
|
|
||||||
override fun onInitialize() {
|
|
||||||
LOGGER.info("just like old times?")
|
|
||||||
|
|
||||||
/* TODO:
|
|
||||||
* - register worldgen
|
|
||||||
* - biome modification
|
|
||||||
* */
|
|
||||||
|
|
||||||
// blocks
|
|
||||||
RosesBlocks
|
|
||||||
// creative tab entries
|
|
||||||
RosesCreativeTab
|
|
||||||
|
|
||||||
RosesWorldGeneration.generateRosesWorldGen()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue