Compare commits
2 Commits
291d46b4e6
...
71b835b66e
Author | SHA1 | Date | |
---|---|---|---|
71b835b66e | |||
6ca6b35be4 |
@ -1,12 +1,12 @@
|
||||
package de.jottyfan.gta.gdp;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jottyfan.gta.gdp.block.ModBlocks;
|
||||
import de.jottyfan.gta.gdp.item.ModItems;
|
||||
import de.jottyfan.gta.gdp.world.gen.ModOreGeneration;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -21,5 +21,6 @@ public class GTAGDP implements ModInitializer {
|
||||
public void onInitialize() {
|
||||
ModItems.registerModItems();
|
||||
ModBlocks.registerModBlocks();
|
||||
ModOreGeneration.generateOres();
|
||||
}
|
||||
}
|
@ -26,6 +26,8 @@ public class ModBlocks {
|
||||
.luminance(state -> state.get(RubyBlock.ACTIVATED) ? 15 : 0));
|
||||
public static final Block RUBY_ORE = registerBlock(Identifier.of(GTAGDP.MOD_ID, "ruby_ore"),
|
||||
AbstractBlock.Settings.create().strength(3f).requiresTool());
|
||||
public static final Block RUBY_DEEPSLATE_ORE = registerBlock(Identifier.of(GTAGDP.MOD_ID, "ruby_deepslate_ore"),
|
||||
AbstractBlock.Settings.create().strength(3f).requiresTool());
|
||||
|
||||
private static Block registerRubyBlock(Identifier identifier, Block.Settings settings) {
|
||||
Block block = new RubyBlock(settings.registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
|
||||
@ -50,6 +52,7 @@ public class ModBlocks {
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> {
|
||||
entries.add(RUBY_BLOCK);
|
||||
entries.add(RUBY_ORE);
|
||||
entries.add(RUBY_DEEPSLATE_ORE);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
@ -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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "gtagdp:block/ruby_deepslate_ore"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtagdp:block/ruby_deepslate_ore"
|
||||
}
|
||||
}
|
@ -3,5 +3,6 @@
|
||||
"item.gtagdp.rubyball": "Rubinball",
|
||||
|
||||
"block.gtagdp.ruby_block": "Rubinblock",
|
||||
"block.gtagdp.ruby_ore": "Rubinerz"
|
||||
"block.gtagdp.ruby_ore": "Rubinerz",
|
||||
"block.gtagdp.ruby_deepslate_ore": "Rubinerzklumpen"
|
||||
}
|
@ -3,5 +3,6 @@
|
||||
"item.gtagdp.rubyball": "Ruby ball",
|
||||
|
||||
"block.gtagdp.ruby_block": "Ruby block",
|
||||
"block.gtagdp.ruby_ore": "Ruby ore"
|
||||
"block.gtagdp.ruby_ore": "Ruby ore",
|
||||
"block.gtagdp.ruby_deepslate_ore": "Ruby ore lump"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "gtagdp:block/ruby_deepslate_ore"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "gtagdp:block/ruby_deepslate_ore"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "gtagdp:ruby_ore"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
"replace": false,
|
||||
"values": [
|
||||
"gtagdp:ruby_block",
|
||||
"gtagdp:ruby_ore"
|
||||
"gtagdp:ruby_ore",
|
||||
"gtagdp:ruby_deepslate_ore"
|
||||
]
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
"replace": false,
|
||||
"values": [
|
||||
"gtagdp:ruby_block",
|
||||
"gtagdp:ruby_ore"
|
||||
"gtagdp:ruby_ore",
|
||||
"gtagdp:ruby_deepslate_ore"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user