added ore generation

This commit is contained in:
Jottyfan
2025-06-09 14:19:35 +02:00
parent 6ca6b35be4
commit 71b835b66e
5 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package de.jottyfan.gta.gdp.world;
import de.jottyfan.gta.gdp.GTAGDP;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.gen.feature.ConfiguredFeature;
/**
* @author jotty
*/
public class ModConfiguredFeatures {
public static final RegistryKey<ConfiguredFeature<?, ?>> RUBY_ORE_CF = registerKey("ruby_ore_cf");
public static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(GTAGDP.MOD_ID, name));
}
}

View File

@ -0,0 +1,19 @@
package de.jottyfan.gta.gdp.world;
import de.jottyfan.gta.gdp.GTAGDP;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.gen.feature.PlacedFeature;
/**
* @author jotty
*/
public class ModPlacedFeatures {
public static final RegistryKey<PlacedFeature> RUBY_ORE_PF = registerKey("ruby_ore_pf");
public static RegistryKey<PlacedFeature> registerKey(String name) {
return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(GTAGDP.MOD_ID, name));
}
}

View File

@ -0,0 +1,16 @@
package de.jottyfan.gta.gdp.world.gen;
import de.jottyfan.gta.gdp.world.ModPlacedFeatures;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.minecraft.world.gen.GenerationStep;
/**
* @author jotty
*/
public class ModOreGeneration {
public static void generateOres() {
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES,
ModPlacedFeatures.RUBY_ORE_PF);
}
}

View File

@ -0,0 +1,27 @@
{
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 0.0,
"size": 20,
"targets": [
{
"state": {
"Name": "gtagdp:ruby_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:stone_ore_replaceables"
}
},
{
"state": {
"Name": "gtagdp:ruby_deepslate_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:deepslate_ore_replaceables"
}
}
]
}
}

View File

@ -0,0 +1,27 @@
{
"feature": "gtagdp:ruby_ore_cf",
"placement": [
{
"type": "minecraft:count",
"count": 16
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:trapezoid",
"max_inclusive": {
"absolute": 80
},
"min_inclusive": {
"absolute": -80
}
}
},
{
"type": "minecraft:biome"
}
]
}