diff --git a/src/main/java/xyz/limepot/roses_mod/RosesMod.java b/src/main/java/xyz/limepot/roses_mod/RosesMod.java index ab1fe59..9e54889 100644 --- a/src/main/java/xyz/limepot/roses_mod/RosesMod.java +++ b/src/main/java/xyz/limepot/roses_mod/RosesMod.java @@ -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 diff --git a/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java b/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java new file mode 100644 index 0000000..ae1d233 --- /dev/null +++ b/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java @@ -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 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 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 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> cyanRoseBushTag = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bush")); + RegistryKey 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"))); + } +} diff --git a/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java b/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java new file mode 100644 index 0000000..868274f --- /dev/null +++ b/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java @@ -0,0 +1,7 @@ +package xyz.limepot.roses_mod.world.gen; + +public class ModWorldGen { + public static void generateWorldGen() { + ModFlowerGeneration.generateFlowers(); + } +} diff --git a/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json new file mode 100644 index 0000000..0e8d141 --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json @@ -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" + } +} diff --git a/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json new file mode 100644 index 0000000..310cbbe --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json @@ -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" + } + ] +}