This commit is contained in:
@@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jottyfan.minecraft.block.ModBlocks;
|
||||
import de.jottyfan.minecraft.item.ModItems;
|
||||
import de.jottyfan.minecraft.world.gen.ModOreGeneration;
|
||||
|
||||
public class Gtamfmd implements ModInitializer {
|
||||
public static final String MOD_ID = "gtamfmd";
|
||||
@@ -16,6 +17,7 @@ public class Gtamfmd implements ModInitializer {
|
||||
public void onInitialize() {
|
||||
ModItems.registerModItems();
|
||||
ModBlocks.registerModBlocks();
|
||||
ModOreGeneration.generateOres();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package de.jottyfan.minecraft.world;
|
||||
|
||||
import de.jottyfan.minecraft.Gtamfmd;
|
||||
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");
|
||||
|
||||
private static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
||||
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(Gtamfmd.MOD_ID, name));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package de.jottyfan.minecraft.world;
|
||||
|
||||
import de.jottyfan.minecraft.Gtamfmd;
|
||||
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");
|
||||
|
||||
private static RegistryKey<PlacedFeature> registerKey(String name) {
|
||||
return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(Gtamfmd.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package de.jottyfan.minecraft.world.gen;
|
||||
|
||||
import de.jottyfan.minecraft.world.ModPlacedFeatures;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
|
||||
public class ModOreGeneration {
|
||||
public static void generateOres() {
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(),
|
||||
GenerationStep.Feature.UNDERGROUND_ORES,
|
||||
ModPlacedFeatures.RUBY_ORE_PF);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{ "type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 20,
|
||||
"targets": [
|
||||
{
|
||||
"state": { "Name": "gtamfmd:ruby_ore" },
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
}, {
|
||||
"state": { "Name": "gtamfmd:ruby_deepslate_ore" },
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"feature": "gtamfmd: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"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user