World Gen Attempt 1

This commit is contained in:
nelle 2023-01-10 04:58:13 -07:00
parent 32058b40f6
commit 31a8e612cd
5 changed files with 102 additions and 2 deletions

View file

@ -19,6 +19,7 @@ import org.quiltmc.qsl.block.extensions.api.QuiltBlockSettings;
import org.quiltmc.qsl.item.setting.api.QuiltItemSettings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import xyz.limepot.roses_mod.world.gen.ModWorldGen;
//import xyz.limepot.roses_mod.world.feature.ModConfiguredFeatures;
public class RosesMod implements ModInitializer {
@ -37,8 +38,8 @@ public class RosesMod implements ModInitializer {
@Override
public void onInitialize(ModContainer mod) {
//REGISTER CONFIGURED FEATURES
//ModConfiguredFeatures.registerConfiguredFeatures();
//REGISTER WORLDGEN
ModWorldGen.generateWorldGen();
//REGISTER BLOCKS AND BLOCK ITEMS
//TODO: ADD ITEMS TO CREATIVE TABS

View file

@ -0,0 +1,37 @@
package xyz.limepot.roses_mod.world.gen;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.PlacedFeature;
import org.quiltmc.qsl.worldgen.biome.api.BiomeModifications;
import org.quiltmc.qsl.worldgen.biome.api.BiomeSelectors;
import static xyz.limepot.roses_mod.RosesMod.MOD_ID;
public class ModFlowerGeneration {
/*
public static void generateFlowers() {
//ROSE FLOWER
RegistryKey<TagKey> roseFlowerTag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "rose_flowers"));
BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, roseFlowerTag);
//CYAN ROSE
RegistryKey<TagKey> cyanRoseTag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "cyan_roses"));
BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, cyanRoseTag);
//CYAN ROSE BUSH
RegistryKey<TagKey> cyanRoseBushTag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "cyan_rose_bushes"));
BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, cyanRoseBushTag);
}
*/
public static void generateFlowers() {
RegistryKey<ConfiguredFeature<?, ?>> cyanRoseBushTag = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bush"));
RegistryKey<PlacedFeature> cyanRoseBushTagKey = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bushes"));
BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.FOREST),
GenerationStep.Feature.VEGETAL_DECORATION,
RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bush")));
}
}

View file

@ -0,0 +1,7 @@
package xyz.limepot.roses_mod.world.gen;
public class ModWorldGen {
public static void generateWorldGen() {
ModFlowerGeneration.generateFlowers();
}
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:vegetation_patch",
"config": {
"surface": "floor",
"depth": 1,
"vertical_range": 1,
"extra_bottom_block_chance": 0,
"extra_edge_column_chance": 0,
"vegetation_chance": 0.2,
"xz_radius": 0,
"replaceable": "#minecraft:tall_flowers",
"ground_state": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:grass_block"
}
},
"vegetation_feature": "roses_mod:cyan_rose_bush"
}
}

View file

@ -0,0 +1,35 @@
{
"feature": {
"type": "minecraft:vegetation_patch",
"config": {
"surface": "floor",
"depth": 1,
"vertical_range": 1,
"extra_bottom_block_chance": 0,
"extra_edge_column_chance": 0,
"vegetation_chance": 0.2,
"xz_radius": 0,
"replaceable": "#minecraft:tall_flowers",
"ground_state": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:grass_block"
}
},
"vegetation_feature": "roses_mod:cyan_rose_bush"
}
},
"placement": [
{
"type": "minecraft:count",
"count": 4
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
}
]
}