diff --git a/src/main/java/net/stal/alloys/StalAlloys.java b/src/main/java/net/stal/alloys/StalAlloys.java index 3f60f32..ac20479 100644 --- a/src/main/java/net/stal/alloys/StalAlloys.java +++ b/src/main/java/net/stal/alloys/StalAlloys.java @@ -1,6 +1,7 @@ package net.stal.alloys; import net.fabricmc.api.ModInitializer; +import net.stal.alloys.item.StalAlloysItemGroup; // import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.stal.alloys.item.StalAlloysItems; import net.stal.alloys.networking.StalAlloysMessages; @@ -28,6 +29,8 @@ public void onInitialize() { // Configured Features Must be called first StalAlloysConfiguredFeatures.registerConfiguredFeatures(); + StalAlloysItemGroup.registerItemGroup(); + StalAlloysItems.registerModItems(); StalAlloysBlocks.registerModBlocks(); diff --git a/src/main/java/net/stal/alloys/StalAlloysDataGenerator.java b/src/main/java/net/stal/alloys/StalAlloysDataGenerator.java index 21894b4..1642d28 100644 --- a/src/main/java/net/stal/alloys/StalAlloysDataGenerator.java +++ b/src/main/java/net/stal/alloys/StalAlloysDataGenerator.java @@ -2,13 +2,29 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; -import net.stal.alloys.datagen.StalAlloysLootTableGenerator; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKeys; +import net.stal.alloys.datagen.*; +import net.stal.alloys.world.StalAlloysConfiguredFeatures; +import net.stal.alloys.world.StalAlloysPlacedFeatures; public class StalAlloysDataGenerator implements DataGeneratorEntrypoint { @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { StalAlloys.LOGGER.debug("Initializing Data Generator for " + StalAlloys.MOD_ID); - fabricDataGenerator.addProvider(StalAlloysLootTableGenerator::new); + FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); + + pack.addProvider(StalAlloysLootTableGenerator::new); + pack.addProvider(StalAlloysWorldGenerator::new); + } + + @Override + public void buildRegistry(RegistryBuilder registryBuilder) { + DataGeneratorEntrypoint.super.buildRegistry(registryBuilder); + + // Frustratingly the lambda is necessary here... + registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, (context) -> StalAlloysConfiguredFeatures.bootstrap(context)); + registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, StalAlloysPlacedFeatures::bootstrap); } } diff --git a/src/main/java/net/stal/alloys/block/StalAlloysBlocks.java b/src/main/java/net/stal/alloys/block/StalAlloysBlocks.java index d69a1f4..5638906 100644 --- a/src/main/java/net/stal/alloys/block/StalAlloysBlocks.java +++ b/src/main/java/net/stal/alloys/block/StalAlloysBlocks.java @@ -1,72 +1,24 @@ package net.stal.alloys.block; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.*; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemGroup.Builder; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; import net.minecraft.util.math.intprovider.UniformIntProvider; -import net.minecraft.util.registry.Registry; import net.stal.alloys.StalAlloys; import net.stal.alloys.item.StalAlloysItemGroup; public class StalAlloysBlocks { // Block: Steel - // public static final Block STEEL_ORE = registerBlock( - // "steel_ore", - // new OreBlock( - // FabricBlockSettings - // .of(Material.STONE) - // .sounds(BlockSoundGroup.STONE) - // .strength(3.0F, 8.0F) - // .requiresTool(), - // UniformIntProvider.create(3, 8) - // ), - // StalAlloysItemGroup.STAL_ALLOYS - // ); - - // public static final Block DEEPSLATE_STEEL_ORE = registerBlock( - // "deepslate_steel_ore", - // new OreBlock( - // FabricBlockSettings - // .of(Material.STONE) - // .sounds(BlockSoundGroup.DEEPSLATE) - // .strength(4.5F, 8.0F) - // .requiresTool(), - // UniformIntProvider.create(4, 9) - // ), - // StalAlloysItemGroup.STAL_ALLOYS - // ); - - // public static final Block NETHERRACK_STEEL_ORE = registerBlock( - // "netherrack_steel_ore", - // new OreBlock( - // FabricBlockSettings - // .of(Material.STONE) - // .sounds(BlockSoundGroup.NETHERRACK) - // .strength(0.4F) - // .requiresTool(), - // UniformIntProvider.create(4, 9) - // ), - // StalAlloysItemGroup.STAL_ALLOYS - // ); - - // public static final Block ENDSTONE_STEEL_ORE = registerBlock( - // "endstone_steel_ore", - // new OreBlock( - // FabricBlockSettings - // .of(Material.STONE) - // .sounds(BlockSoundGroup.STONE) - // .strength(3.0F, 9.0F) - // .requiresTool(), - // UniformIntProvider.create(4, 9) - // ), - // StalAlloysItemGroup.STAL_ALLOYS - // ); public static final Block STEEL_BLOCK = registerBlock( "steel_block", @@ -83,7 +35,7 @@ public class StalAlloysBlocks { // Block: Nickel public static final Block NICKEL_ORE = registerBlock( "nickel_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.STONE) @@ -96,7 +48,7 @@ public class StalAlloysBlocks { public static final Block DEEPSLATE_NICKEL_ORE = registerBlock( "deepslate_nickel_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.DEEPSLATE) @@ -109,7 +61,7 @@ public class StalAlloysBlocks { public static final Block NETHERRACK_NICKEL_ORE = registerBlock( "netherrack_nickel_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.NETHERRACK) @@ -172,7 +124,7 @@ public class StalAlloysBlocks { // Block: Chromium public static final Block CHROMIUM_ORE = registerBlock( "chromium_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.STONE) @@ -185,7 +137,7 @@ public class StalAlloysBlocks { public static final Block DEEPSLATE_CHROMIUM_ORE = registerBlock( "deepslate_chromium_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.DEEPSLATE) @@ -198,7 +150,7 @@ public class StalAlloysBlocks { public static final Block NETHERRACK_CHROMIUM_ORE = registerBlock( "netherrack_chromium_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.NETHERRACK) @@ -224,7 +176,7 @@ public class StalAlloysBlocks { // Block: Carbon public static final Block CARBON_ORE = registerBlock( "carbon_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.STONE) @@ -237,7 +189,7 @@ public class StalAlloysBlocks { public static final Block DEEPSLATE_CARBON_ORE = registerBlock( "deepslate_carbon_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.DEEPSLATE) @@ -251,7 +203,7 @@ public class StalAlloysBlocks { // Block: Zinc public static final Block ZINC_ORE = registerBlock( "zinc_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.STONE) @@ -264,7 +216,7 @@ public class StalAlloysBlocks { public static final Block DEEPSLATE_ZINC_ORE = registerBlock( "deepslate_zinc_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.DEEPSLATE) @@ -290,7 +242,7 @@ public class StalAlloysBlocks { // Block: Tin public static final Block TIN_ORE = registerBlock( "tin_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.STONE) @@ -303,7 +255,7 @@ public class StalAlloysBlocks { public static final Block DEEPSLATE_TIN_ORE = registerBlock( "deepslate_tin_ore", - new OreBlock( + new ExperienceDroppingBlock( FabricBlockSettings .of(Material.STONE) .sounds(BlockSoundGroup.DEEPSLATE) @@ -331,11 +283,15 @@ public class StalAlloysBlocks { private static Block registerBlock(String name, Block block, ItemGroup group) { registerBlockItem(name, block, group); - return Registry.register(Registry.BLOCK, new Identifier(StalAlloys.MOD_ID, name), block); + return Registry.register(Registries.BLOCK, new Identifier(StalAlloys.MOD_ID, name), block); } private static Item registerBlockItem(String name, Block block, ItemGroup group) { - return Registry.register(Registry.ITEM, new Identifier(StalAlloys.MOD_ID, name), new BlockItem(block, new FabricItemSettings().group(group))); + Item item = Registry.register(Registries.ITEM, new Identifier(StalAlloys.MOD_ID, name), new BlockItem(block, new FabricItemSettings())); + + ItemGroupEvents.modifyEntriesEvent(group).register(entries -> entries.add(item)); + + return item; } public static void registerModBlocks() { diff --git a/src/main/java/net/stal/alloys/block/entity/StalAlloysBlockEntities.java b/src/main/java/net/stal/alloys/block/entity/StalAlloysBlockEntities.java index 79d4632..b816146 100644 --- a/src/main/java/net/stal/alloys/block/entity/StalAlloysBlockEntities.java +++ b/src/main/java/net/stal/alloys/block/entity/StalAlloysBlockEntities.java @@ -2,8 +2,9 @@ import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import net.stal.alloys.StalAlloys; import net.stal.alloys.block.StalAlloysBlocks; @@ -14,7 +15,7 @@ public static void registerModBlockEntities() { StalAlloys.LOGGER.debug("Registering Block Entities for " + StalAlloys.MOD_ID); ALLOY_SMELTER_ENTITY = Registry.register( - Registry.BLOCK_ENTITY_TYPE, + Registries.BLOCK_ENTITY_TYPE, new Identifier( StalAlloys.MOD_ID, "alloy_smelter" diff --git a/src/main/java/net/stal/alloys/datagen/StalAlloysLootTableGenerator.java b/src/main/java/net/stal/alloys/datagen/StalAlloysLootTableGenerator.java index 923bb3b..1d4dac4 100644 --- a/src/main/java/net/stal/alloys/datagen/StalAlloysLootTableGenerator.java +++ b/src/main/java/net/stal/alloys/datagen/StalAlloysLootTableGenerator.java @@ -1,56 +1,38 @@ package net.stal.alloys.datagen; -import java.util.function.BiConsumer; - -import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; -import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider; -import net.minecraft.data.server.BlockLootTableGenerator; -import net.minecraft.loot.LootTable.Builder; -import net.minecraft.loot.context.*; -import net.minecraft.loot.provider.number.*; -import net.minecraft.util.Identifier; -import net.stal.alloys.StalAlloys; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; import net.stal.alloys.block.StalAlloysBlocks; import net.stal.alloys.item.StalAlloysItems; -public class StalAlloysLootTableGenerator extends SimpleFabricLootTableProvider { - public StalAlloysLootTableGenerator(FabricDataGenerator dataGenerator) { - super(dataGenerator, LootContextTypes.BLOCK); +public class StalAlloysLootTableGenerator extends FabricBlockLootTableProvider { + + public StalAlloysLootTableGenerator(FabricDataOutput dataOutput) { + super(dataOutput); } @Override - public void accept(BiConsumer biConsumer) { - // Alloy Smelter - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/alloy_smelter"), BlockLootTableGenerator.drops(StalAlloysBlocks.ALLOY_SMELTER, StalAlloysBlocks.ALLOY_SMELTER, ConstantLootNumberProvider.create(1.0F))); - - // Nickel - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/nickel_block"), BlockLootTableGenerator.drops(StalAlloysBlocks.NICKEL_BLOCK, StalAlloysBlocks.NICKEL_BLOCK, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/cut_nickel"), BlockLootTableGenerator.drops(StalAlloysBlocks.CUT_NICKEL, StalAlloysBlocks.CUT_NICKEL, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/cut_nickel_slab"), BlockLootTableGenerator.drops(StalAlloysBlocks.CUT_NICKEL_SLAB, StalAlloysBlocks.CUT_NICKEL_SLAB, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/cut_nickel_stairs"), BlockLootTableGenerator.drops(StalAlloysBlocks.CUT_NICKEL_STAIRS, StalAlloysBlocks.CUT_NICKEL_STAIRS, ConstantLootNumberProvider.create(1.0F))); - - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/nickel_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.NICKEL_ORE, StalAlloysItems.RAW_NICKEL, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/deepslate_nickel_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.DEEPSLATE_NICKEL_ORE, StalAlloysItems.RAW_NICKEL, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/netherrack_nickel_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.NETHERRACK_NICKEL_ORE, StalAlloysItems.RAW_NICKEL, ConstantLootNumberProvider.create(1.0F))); - - // Chromium - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/chromium_block"), BlockLootTableGenerator.drops(StalAlloysBlocks.CHROMIUM_BLOCK, StalAlloysBlocks.CHROMIUM_BLOCK, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/chromium_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.CHROMIUM_ORE, StalAlloysItems.RAW_CHROMIUM, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/deepslate_chromium_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.DEEPSLATE_CHROMIUM_ORE, StalAlloysItems.RAW_CHROMIUM, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/netherrack_chromium_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.NETHERRACK_CHROMIUM_ORE, StalAlloysItems.RAW_CHROMIUM, ConstantLootNumberProvider.create(1.0F))); - - // Zinc - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/zinc_block"), BlockLootTableGenerator.drops(StalAlloysBlocks.ZINC_BLOCK, StalAlloysBlocks.ZINC_BLOCK, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/zinc_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.ZINC_ORE, StalAlloysItems.RAW_ZINC, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/deepslate_zinc_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.DEEPSLATE_ZINC_ORE, StalAlloysItems.RAW_ZINC, ConstantLootNumberProvider.create(1.0F))); - - // Tin - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/tin_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.TIN_ORE, StalAlloysItems.RAW_TIN, ConstantLootNumberProvider.create(1.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/deepslate_tin_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.DEEPSLATE_TIN_ORE, StalAlloysItems.RAW_TIN, ConstantLootNumberProvider.create(1.0F))); - - // Carbon - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/carbon_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.CARBON_ORE, StalAlloysItems.RAW_CARBON, UniformLootNumberProvider.create(2.0F, 6.0F))); - biConsumer.accept(new Identifier(StalAlloys.MOD_ID, "blocks/deepslate_carbon_ore"), BlockLootTableGenerator.drops(StalAlloysBlocks.DEEPSLATE_CARBON_ORE, StalAlloysItems.RAW_CARBON, UniformLootNumberProvider.create(2.0F, 6.0F))); + public void generate() { + addDrop(StalAlloysBlocks.ALLOY_SMELTER, nameableContainerDrops(StalAlloysBlocks.ALLOY_SMELTER)); + + addDrop(StalAlloysBlocks.NICKEL_BLOCK); + addDrop(StalAlloysBlocks.CUT_NICKEL); + addDrop(StalAlloysBlocks.CUT_NICKEL_SLAB); + addDrop(StalAlloysBlocks.CUT_NICKEL_STAIRS); + addDrop(StalAlloysBlocks.NICKEL_ORE, oreDrops(StalAlloysBlocks.NICKEL_ORE, StalAlloysItems.RAW_NICKEL)); + addDrop(StalAlloysBlocks.DEEPSLATE_NICKEL_ORE, oreDrops(StalAlloysBlocks.DEEPSLATE_NICKEL_ORE, StalAlloysItems.RAW_NICKEL)); + addDrop(StalAlloysBlocks.NETHERRACK_NICKEL_ORE, oreDrops(StalAlloysBlocks.NETHERRACK_NICKEL_ORE, StalAlloysItems.RAW_NICKEL)); + + addDrop(StalAlloysBlocks.CHROMIUM_BLOCK); + addDrop(StalAlloysBlocks.NETHERRACK_CHROMIUM_ORE, oreDrops(StalAlloysBlocks.NETHERRACK_CHROMIUM_ORE, StalAlloysItems.RAW_CHROMIUM)); + + addDrop(StalAlloysBlocks.ZINC_BLOCK); + addDrop(StalAlloysBlocks.ZINC_ORE, oreDrops(StalAlloysBlocks.ZINC_ORE, StalAlloysItems.RAW_ZINC)); + addDrop(StalAlloysBlocks.DEEPSLATE_ZINC_ORE, oreDrops(StalAlloysBlocks.DEEPSLATE_ZINC_ORE, StalAlloysItems.RAW_ZINC)); + + addDrop(StalAlloysBlocks.TIN_ORE, oreDrops(StalAlloysBlocks.TIN_ORE, StalAlloysItems.RAW_TIN)); + addDrop(StalAlloysBlocks.DEEPSLATE_TIN_ORE, oreDrops(StalAlloysBlocks.DEEPSLATE_TIN_ORE, StalAlloysItems.RAW_TIN)); + + addDrop(StalAlloysBlocks.DEEPSLATE_CARBON_ORE, oreDrops(StalAlloysBlocks.DEEPSLATE_CARBON_ORE, StalAlloysItems.RAW_CARBON)); } - } diff --git a/src/main/java/net/stal/alloys/datagen/StalAlloysWorldGenerator.java b/src/main/java/net/stal/alloys/datagen/StalAlloysWorldGenerator.java new file mode 100644 index 0000000..f7b1ddd --- /dev/null +++ b/src/main/java/net/stal/alloys/datagen/StalAlloysWorldGenerator.java @@ -0,0 +1,28 @@ +package net.stal.alloys.datagen; + +import java.util.concurrent.CompletableFuture; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.stal.alloys.StalAlloys; + +public class StalAlloysWorldGenerator extends FabricDynamicRegistryProvider { + + public StalAlloysWorldGenerator(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) { + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE)); + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE)); + } + + @Override + public String getName() { + return StalAlloys.MOD_ID; + } + +} diff --git a/src/main/java/net/stal/alloys/item/StalAlloysItemGroup.java b/src/main/java/net/stal/alloys/item/StalAlloysItemGroup.java index 0852dca..ba08463 100644 --- a/src/main/java/net/stal/alloys/item/StalAlloysItemGroup.java +++ b/src/main/java/net/stal/alloys/item/StalAlloysItemGroup.java @@ -1,14 +1,20 @@ package net.stal.alloys.item; -import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; +import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.stal.alloys.StalAlloys; import net.stal.alloys.block.StalAlloysBlocks; public class StalAlloysItemGroup { - public static ItemGroup STAL_ALLOYS = FabricItemGroupBuilder.build( - new Identifier(StalAlloys.MOD_ID, "stal_alloys"), () -> new ItemStack(StalAlloysBlocks.ALLOY_SMELTER) - ); + + public static ItemGroup STAL_ALLOYS; + + public static void registerItemGroup() { + STAL_ALLOYS = FabricItemGroup.builder(new Identifier(StalAlloys.MOD_ID, "stal_alloys")) + .displayName(Text.translatable("itemGroup" + "." + StalAlloys.MOD_ID)) + .icon(() -> new ItemStack(StalAlloysBlocks.ALLOY_SMELTER)).build(); + } } diff --git a/src/main/java/net/stal/alloys/item/StalAlloysItems.java b/src/main/java/net/stal/alloys/item/StalAlloysItems.java index 9c8c4ac..b7a3c36 100644 --- a/src/main/java/net/stal/alloys/item/StalAlloysItems.java +++ b/src/main/java/net/stal/alloys/item/StalAlloysItems.java @@ -1,68 +1,113 @@ package net.stal.alloys.item; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.minecraft.entity.EquipmentSlot; import net.minecraft.item.*; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import net.stal.alloys.*; import net.stal.alloys.item.custom.StalAlloysHoeItem; public class StalAlloysItems { - // public static final Item RAW_STEEL = registerItem("raw_steel", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STEEL_INGOT = registerItem("steel_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item STEEL_INGOT = registerItem("steel_ingot", new Item(new FabricItemSettings())); - public static final Item RAW_NICKEL = registerItem("raw_nickel", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item NICKEL_INGOT = registerItem("nickel_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item RAW_NICKEL = registerItem("raw_nickel", new Item(new FabricItemSettings())); + public static final Item NICKEL_INGOT = registerItem("nickel_ingot", new Item(new FabricItemSettings())); - public static final Item RAW_CHROMIUM = registerItem("raw_chromium", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item CHROMIUM_INGOT = registerItem("chromium_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item RAW_CHROMIUM = registerItem("raw_chromium", new Item(new FabricItemSettings())); + public static final Item CHROMIUM_INGOT = registerItem("chromium_ingot", new Item(new FabricItemSettings())); - public static final Item RAW_CARBON = registerItem("raw_carbon", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item CARBON_PLATE = registerItem("carbon_plate", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item RAW_CARBON = registerItem("raw_carbon", new Item(new FabricItemSettings())); + public static final Item CARBON_PLATE = registerItem("carbon_plate", new Item(new FabricItemSettings())); - public static final Item RAW_ZINC = registerItem("raw_zinc", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item ZINC_INGOT = registerItem("zinc_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item RAW_ZINC = registerItem("raw_zinc", new Item(new FabricItemSettings())); + public static final Item ZINC_INGOT = registerItem("zinc_ingot", new Item(new FabricItemSettings())); - public static final Item RAW_TIN = registerItem("raw_tin", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item TIN_INGOT = registerItem("tin_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item RAW_TIN = registerItem("raw_tin", new Item(new FabricItemSettings())); + public static final Item TIN_INGOT = registerItem("tin_ingot", new Item(new FabricItemSettings())); - public static final Item COPPER_SWORD = registerItem("copper_sword", new SwordItem(ToolMaterials.IRON, 3, -2.4F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item COPPER_PICKAXE = registerItem("copper_pickaxe", new PickaxeItem(ToolMaterials.IRON, 1, -2.8F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item COPPER_AXE = registerItem("copper_axe", new AxeItem(ToolMaterials.IRON, 6.0f, -3.1F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item COPPER_SHOVEL = registerItem("copper_shovel", new ShovelItem(ToolMaterials.IRON, 1.5f, -3.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item COPPER_HOE = registerItem("copper_hoe", new StalAlloysHoeItem(ToolMaterials.IRON, -2, -1.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item COPPER_SWORD = registerItem("copper_sword", new SwordItem(ToolMaterials.IRON, 3, -2.4F, new FabricItemSettings())); + public static final Item COPPER_PICKAXE = registerItem("copper_pickaxe", new PickaxeItem(ToolMaterials.IRON, 1, -2.8F, new FabricItemSettings())); + public static final Item COPPER_AXE = registerItem("copper_axe", new AxeItem(ToolMaterials.IRON, 6.0f, -3.1F, new FabricItemSettings())); + public static final Item COPPER_SHOVEL = registerItem("copper_shovel", new ShovelItem(ToolMaterials.IRON, 1.5f, -3.0F, new FabricItemSettings())); + public static final Item COPPER_HOE = registerItem("copper_hoe", new StalAlloysHoeItem(ToolMaterials.IRON, -2, -1.0F, new FabricItemSettings())); - public static final Item BRONZE_INGOT = registerItem("bronze_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRONZE_SWORD = registerItem("bronze_sword", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 3, -2.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRONZE_AXE = registerItem("bronze_axe", new AxeItem(StalAlloysToolMaterials.BRONZE_ALLOY, 6, -3.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRONZE_DAGGER = registerItem("bronze_dagger", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 2, -1.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRONZE_DIRK = registerItem("bronze_dirk", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 2, -1.8F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRASS_INGOT = registerItem("brass_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item BRONZE_INGOT = registerItem("bronze_ingot", new Item(new FabricItemSettings())); + public static final Item BRONZE_SWORD = registerItem("bronze_sword", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 3, -2.0F, new FabricItemSettings())); + public static final Item BRONZE_AXE = registerItem("bronze_axe", new AxeItem(StalAlloysToolMaterials.BRONZE_ALLOY, 6, -3.0F, new FabricItemSettings())); + public static final Item BRONZE_DAGGER = registerItem("bronze_dagger", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 2, -1.0F, new FabricItemSettings())); + public static final Item BRONZE_DIRK = registerItem("bronze_dirk", new SwordItem(StalAlloysToolMaterials.BRONZE_ALLOY, 2, -1.8F, new FabricItemSettings())); + public static final Item BRASS_INGOT = registerItem("brass_ingot", new Item(new FabricItemSettings())); - public static final Item STEEL_PICKAXE = registerItem("steel_pickaxe", new PickaxeItem(StalAlloysToolMaterials.STEEL_ALLOY, 1, -2.8F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STEEL_AXE = registerItem("steel_axe", new AxeItem(StalAlloysToolMaterials.STEEL_ALLOY, 6, -3.1F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STEEL_SHOVEL = registerItem("steel_shovel", new ShovelItem(StalAlloysToolMaterials.STEEL_ALLOY, 1.5F, -3.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STEEL_HOE = registerItem("steel_hoe", new StalAlloysHoeItem(StalAlloysToolMaterials.STEEL_ALLOY, 2, -1.0F, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item STEEL_PICKAXE = registerItem("steel_pickaxe", new PickaxeItem(StalAlloysToolMaterials.STEEL_ALLOY, 1, -2.8F, new FabricItemSettings())); + public static final Item STEEL_AXE = registerItem("steel_axe", new AxeItem(StalAlloysToolMaterials.STEEL_ALLOY, 6, -3.1F, new FabricItemSettings())); + public static final Item STEEL_SHOVEL = registerItem("steel_shovel", new ShovelItem(StalAlloysToolMaterials.STEEL_ALLOY, 1.5F, -3.0F, new FabricItemSettings())); + public static final Item STEEL_HOE = registerItem("steel_hoe", new StalAlloysHoeItem(StalAlloysToolMaterials.STEEL_ALLOY, 2, -1.0F, new FabricItemSettings())); - public static final Item BRASS_HELMET = registerItem("brass_helmet", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.HEAD, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRASS_CHESTPLATE = registerItem("brass_chestplate", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.CHEST, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRASS_LEGGINGS = registerItem("brass_leggings", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.LEGS, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item BRASS_BOOTS = registerItem("brass_boots", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.FEET, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item BRASS_HELMET = registerItem("brass_helmet", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.HEAD, new FabricItemSettings())); + public static final Item BRASS_CHESTPLATE = registerItem("brass_chestplate", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.CHEST, new FabricItemSettings())); + public static final Item BRASS_LEGGINGS = registerItem("brass_leggings", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.LEGS, new FabricItemSettings())); + public static final Item BRASS_BOOTS = registerItem("brass_boots", new ArmorItem(StalAlloysArmorMaterials.BRASS, EquipmentSlot.FEET, new FabricItemSettings())); - public static final Item STAINLESS_STEEL_INGOT = registerItem("stainless_steel_ingot", new Item(new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item STAINLESS_STEEL_INGOT = registerItem("stainless_steel_ingot", new Item(new FabricItemSettings())); - public static final Item STAINLESS_STEEL_HELMET = registerItem("stainless_steel_helmet", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.HEAD, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STAINLESS_STEEL_CHESTPLATE = registerItem("stainless_steel_chestplate", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.CHEST, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STAINLESS_STEEL_LEGGINGS = registerItem("stainless_steel_leggings", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.LEGS, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); - public static final Item STAINLESS_STEEL_BOOTS = registerItem("stainless_steel_boots", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.FEET, new FabricItemSettings().group(StalAlloysItemGroup.STAL_ALLOYS))); + public static final Item STAINLESS_STEEL_HELMET = registerItem("stainless_steel_helmet", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.HEAD, new FabricItemSettings())); + public static final Item STAINLESS_STEEL_CHESTPLATE = registerItem("stainless_steel_chestplate", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.CHEST, new FabricItemSettings())); + public static final Item STAINLESS_STEEL_LEGGINGS = registerItem("stainless_steel_leggings", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.LEGS, new FabricItemSettings())); + public static final Item STAINLESS_STEEL_BOOTS = registerItem("stainless_steel_boots", new ArmorItem(StalAlloysArmorMaterials.STAINLESS_STEEL, EquipmentSlot.FEET, new FabricItemSettings())); private static Item registerItem(String name, Item item) { - return Registry.register(Registry.ITEM, new Identifier(StalAlloys.MOD_ID, name), item); + return Registry.register(Registries.ITEM, new Identifier(StalAlloys.MOD_ID, name), item); + } + + public static void addToItemGroup(ItemGroup group, Item item) { + ItemGroupEvents.modifyEntriesEvent(group).register(entries -> entries.add(item)); + } + + public static void addItemsToItemGroups() { + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STEEL_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, RAW_NICKEL); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, NICKEL_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, RAW_CHROMIUM); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, CHROMIUM_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, RAW_CARBON); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, CARBON_PLATE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, RAW_ZINC); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, ZINC_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, RAW_TIN); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, TIN_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, COPPER_SWORD); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, COPPER_PICKAXE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, COPPER_AXE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, COPPER_SHOVEL); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, COPPER_HOE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRONZE_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRONZE_SWORD); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRONZE_AXE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRONZE_DAGGER); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRONZE_DIRK); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRASS_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRASS_HELMET); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRASS_CHESTPLATE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRASS_LEGGINGS); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, BRASS_BOOTS); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STEEL_PICKAXE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STEEL_AXE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STEEL_SHOVEL); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STEEL_HOE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STAINLESS_STEEL_INGOT); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STAINLESS_STEEL_HELMET); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STAINLESS_STEEL_CHESTPLATE); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STAINLESS_STEEL_LEGGINGS); + addToItemGroup(StalAlloysItemGroup.STAL_ALLOYS, STAINLESS_STEEL_BOOTS); } public static void registerModItems() { StalAlloys.LOGGER.debug("Registering Mod Items for " + StalAlloys.MOD_ID); + + addItemsToItemGroups(); } } diff --git a/src/main/java/net/stal/alloys/recipe/StalAlloysRecipes.java b/src/main/java/net/stal/alloys/recipe/StalAlloysRecipes.java index 52ad411..8616c4d 100644 --- a/src/main/java/net/stal/alloys/recipe/StalAlloysRecipes.java +++ b/src/main/java/net/stal/alloys/recipe/StalAlloysRecipes.java @@ -1,7 +1,8 @@ package net.stal.alloys.recipe; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import net.stal.alloys.StalAlloys; public class StalAlloysRecipes { @@ -10,14 +11,14 @@ public static void registerRecipes() { // Alloy Smelter Serializer Registry.register( - Registry.RECIPE_SERIALIZER, + Registries.RECIPE_SERIALIZER, new Identifier(StalAlloys.MOD_ID, AlloySmelterRecipe.Serializer.ID), AlloySmelterRecipe.Serializer.INSTANCE ); // Alloy Smelter Type Registry.register( - Registry.RECIPE_TYPE, + Registries.RECIPE_TYPE, new Identifier(StalAlloys.MOD_ID, AlloySmelterRecipe.Type.ID), AlloySmelterRecipe.Type.INSTANCE ); diff --git a/src/main/java/net/stal/alloys/screen/AlloySmelterScreen.java b/src/main/java/net/stal/alloys/screen/AlloySmelterScreen.java index 8e7cb4f..fc68fe1 100644 --- a/src/main/java/net/stal/alloys/screen/AlloySmelterScreen.java +++ b/src/main/java/net/stal/alloys/screen/AlloySmelterScreen.java @@ -28,7 +28,7 @@ protected void init() { @Override protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) { - RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, ALLOY_SMELTER_SCREEN_TEXTURE); diff --git a/src/main/java/net/stal/alloys/screen/AlloySmelterScreenHandler.java b/src/main/java/net/stal/alloys/screen/AlloySmelterScreenHandler.java index fc892b3..9ccf913 100644 --- a/src/main/java/net/stal/alloys/screen/AlloySmelterScreenHandler.java +++ b/src/main/java/net/stal/alloys/screen/AlloySmelterScreenHandler.java @@ -50,7 +50,7 @@ public AlloySmelterScreenHandler(int syncId, PlayerInventory playerInventory, In } @Override - public ItemStack transferSlot(PlayerEntity player, int inventorySlot) { + public ItemStack quickMove(PlayerEntity player, int inventorySlot) { ItemStack newStack = ItemStack.EMPTY; Slot slot = this.slots.get(inventorySlot); if (slot != null && slot.hasStack()) { diff --git a/src/main/java/net/stal/alloys/screen/StalAlloysScreenHandlers.java b/src/main/java/net/stal/alloys/screen/StalAlloysScreenHandlers.java index a00d5ac..0e4bf8f 100644 --- a/src/main/java/net/stal/alloys/screen/StalAlloysScreenHandlers.java +++ b/src/main/java/net/stal/alloys/screen/StalAlloysScreenHandlers.java @@ -1,14 +1,21 @@ package net.stal.alloys.screen; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.screen.ScreenHandlerType; +import net.minecraft.util.Identifier; import net.stal.alloys.StalAlloys; public class StalAlloysScreenHandlers { public static ScreenHandlerType ALLOY_SMELTER_SCREEN_HANDLER; + static { + ALLOY_SMELTER_SCREEN_HANDLER = new ScreenHandlerType<>(AlloySmelterScreenHandler::new); + } + public static void registerModScreenHandlers() { StalAlloys.LOGGER.debug("Registering screen handlers for " + StalAlloys.MOD_ID); - ALLOY_SMELTER_SCREEN_HANDLER = new ScreenHandlerType<>(AlloySmelterScreenHandler::new); + Registry.register(Registries.SCREEN_HANDLER, new Identifier(StalAlloys.MOD_ID, "alloy_smelter"), ALLOY_SMELTER_SCREEN_HANDLER); } } diff --git a/src/main/java/net/stal/alloys/world/StalAlloysConfiguredFeatures.java b/src/main/java/net/stal/alloys/world/StalAlloysConfiguredFeatures.java index 2de55f3..34ac20b 100644 --- a/src/main/java/net/stal/alloys/world/StalAlloysConfiguredFeatures.java +++ b/src/main/java/net/stal/alloys/world/StalAlloysConfiguredFeatures.java @@ -1,12 +1,15 @@ package net.stal.alloys.world; -import net.minecraft.block.Blocks; -import net.minecraft.structure.rule.BlockMatchRuleTest; -import net.minecraft.util.registry.RegistryEntry; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.structure.rule.RuleTest; +import net.minecraft.structure.rule.TagMatchRuleTest; +import net.minecraft.util.Identifier; import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.ConfiguredFeatures; import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.OreConfiguredFeatures; +import net.minecraft.world.gen.feature.FeatureConfig; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.stal.alloys.StalAlloys; import net.stal.alloys.block.StalAlloysBlocks; @@ -14,94 +17,63 @@ import java.util.List; public class StalAlloysConfiguredFeatures { + public static final RegistryKey> NICKEL_ORE_KEY = registerKey("nickel_ore"); + public static final RegistryKey> NETHERRACK_NICKEL_ORE_KEY = registerKey("netherrack_nickel_ore"); + public static final RegistryKey> NETHERRACK_CHROMIUM_ORE_KEY = registerKey("netherrack_chromium_ore"); + public static final RegistryKey> DEEPSLATE_CARBON_ORE_KEY = registerKey("deepslate_carbon_ore"); + public static final RegistryKey> ZINC_ORE_KEY = registerKey("zinc_ore"); + public static final RegistryKey> TIN_ORE_KEY = registerKey("tin_ore"); + + public static void bootstrap(Registerable> context) { + // var placedFeatureRegistryEntryLookup = context.getRegistryLookup(RegistryKeys.PLACED_FEATURE); + + RuleTest stoneReplaceables = new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES); + RuleTest deepslateReplaceables = new TagMatchRuleTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); + RuleTest netherReplaceables = new TagMatchRuleTest(BlockTags.BASE_STONE_NETHER); + // RuleTest endstoneReplaceables = new BlockMatchRuleTest(Blocks.END_STONE); + + List overworldNickelOres = List.of( + OreFeatureConfig.createTarget(stoneReplaceables, StalAlloysBlocks.NICKEL_ORE.getDefaultState()), + OreFeatureConfig.createTarget(deepslateReplaceables, StalAlloysBlocks.DEEPSLATE_NICKEL_ORE.getDefaultState()) + ); + + List netherNickelOres = List.of( + OreFeatureConfig.createTarget(netherReplaceables, StalAlloysBlocks.NETHERRACK_NICKEL_ORE.getDefaultState()) + ); + + List netherChromiumOres = List.of( + OreFeatureConfig.createTarget(netherReplaceables, StalAlloysBlocks.NETHERRACK_CHROMIUM_ORE.getDefaultState()) + ); + + List overworldCarbonOres = List.of( + OreFeatureConfig.createTarget(deepslateReplaceables, StalAlloysBlocks.DEEPSLATE_CARBON_ORE.getDefaultState()) + ); + + List overworldZincOres = List.of( + OreFeatureConfig.createTarget(stoneReplaceables, StalAlloysBlocks.ZINC_ORE.getDefaultState()), + OreFeatureConfig.createTarget(deepslateReplaceables, StalAlloysBlocks.DEEPSLATE_ZINC_ORE.getDefaultState()) + ); + + List overworldTinOres = List.of( + OreFeatureConfig.createTarget(stoneReplaceables, StalAlloysBlocks.TIN_ORE.getDefaultState()), + OreFeatureConfig.createTarget(deepslateReplaceables, StalAlloysBlocks.DEEPSLATE_TIN_ORE.getDefaultState()) + ); + + register(context, NICKEL_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldNickelOres, 12)); + register(context, NETHERRACK_NICKEL_ORE_KEY, Feature.ORE, new OreFeatureConfig(netherNickelOres, 12)); + register(context, NETHERRACK_CHROMIUM_ORE_KEY, Feature.ORE, new OreFeatureConfig(netherChromiumOres, 4)); + register(context, DEEPSLATE_CARBON_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldCarbonOres, 8)); + register(context, ZINC_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldZincOres, 9)); + register(context, TIN_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldTinOres, 9)); + } - // Steel - // public static final List OVERWORLD_STEEL_ORES = List.of( - // OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.STEEL_ORE.getDefaultState()), - // OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_STEEL_ORE.getDefaultState()) - // ); - - // public static final List NETHER_STEEL_ORES = List.of( - // OreFeatureConfig.createTarget(OreConfiguredFeatures.BASE_STONE_NETHER, StalAlloysBlocks.NETHERRACK_STEEL_ORE.getDefaultState()) - // ); - - // public static final List END_STEEL_ORES = List.of( - // OreFeatureConfig.createTarget(new BlockMatchRuleTest(Blocks.END_STONE), StalAlloysBlocks.ENDSTONE_STEEL_ORE.getDefaultState()) - // ); - - // Nickel - public static final List OVERWORLD_NICKEL_ORES = List.of( - OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.NICKEL_ORE.getDefaultState()), - OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_NICKEL_ORE.getDefaultState()) - ); - - public static final List NETHER_NICKEL_ORES = List.of( - OreFeatureConfig.createTarget(OreConfiguredFeatures.BASE_STONE_NETHER, StalAlloysBlocks.NETHERRACK_NICKEL_ORE.getDefaultState()) - ); - - // Chromium - // public static final List OVERWORLD_CHROMIUM_ORES = List.of( - // OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.CHROMIUM_ORE.getDefaultState()), - // OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_CHROMIUM_ORE.getDefaultState()) - // ); - - public static final List NETHER_CHROMIUM_ORES = List.of( - OreFeatureConfig.createTarget(OreConfiguredFeatures.BASE_STONE_NETHER, StalAlloysBlocks.NETHERRACK_CHROMIUM_ORE.getDefaultState()) - ); - - // Carbon - public static final List OVERWORLD_CARBON_ORES = List.of( - // OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.CARBON_ORE.getDefaultState()), - OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_CARBON_ORE.getDefaultState()) - ); - - // Zinc - public static final List OVERWORLD_ZINC_ORES = List.of( - OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.ZINC_ORE.getDefaultState()), - OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_ZINC_ORE.getDefaultState()) - ); - - // Tin - public static final List OVERWORLD_TIN_ORES = List.of( - OreFeatureConfig.createTarget(OreConfiguredFeatures.STONE_ORE_REPLACEABLES, StalAlloysBlocks.TIN_ORE.getDefaultState()), - OreFeatureConfig.createTarget(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, StalAlloysBlocks.DEEPSLATE_TIN_ORE.getDefaultState()) - ); - - // Steel Registry - // public static final RegistryEntry> STEEL_ORE = - // ConfiguredFeatures.register("steel_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_STEEL_ORES, 9)); - - // public static final RegistryEntry> NETHER_STEEL_ORE = - // ConfiguredFeatures.register("netherrack_steel_ore", Feature.ORE, new OreFeatureConfig(NETHER_STEEL_ORES, 12)); - - // public static final RegistryEntry> END_STEEL_ORE = - // ConfiguredFeatures.register("endstone_steel_ore", Feature.ORE, new OreFeatureConfig(END_STEEL_ORES, 12)); - - // Nickel Registry - public static final RegistryEntry> NICKEL_ORE = - ConfiguredFeatures.register("nickel_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_NICKEL_ORES, 12)); - - public static final RegistryEntry> NETHER_NICKEL_ORE = - ConfiguredFeatures.register("netherrack_nickel_ore", Feature.ORE, new OreFeatureConfig(NETHER_NICKEL_ORES, 12)); - - // Chromium Registry - // public static final RegistryEntry> CHROMIUM_ORE = - // ConfiguredFeatures.register("chromium_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_CHROMIUM_ORES, 9)); - - public static final RegistryEntry> NETHER_CHROMIUM_ORE = - ConfiguredFeatures.register("netherrack_chromium_ore", Feature.ORE, new OreFeatureConfig(NETHER_CHROMIUM_ORES, 4)); - - // Carbon Registry - public static final RegistryEntry> CARBON_ORE = - ConfiguredFeatures.register("carbon_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_CARBON_ORES, 4)); - - // Zinc Registry - public static final RegistryEntry> ZINC_ORE = - ConfiguredFeatures.register("zinc_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_ZINC_ORES, 9)); + public static RegistryKey> registerKey(String name) { + return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(StalAlloys.MOD_ID, name)); + } - // Tin Registry - public static final RegistryEntry> TIN_ORE = - ConfiguredFeatures.register("tin_ore", Feature.ORE, new OreFeatureConfig(OVERWORLD_TIN_ORES, 9)); + private static > void register(Registerable> context, RegistryKey> key, F feature, FC configuration) { + context.register(key, new ConfiguredFeature<>(feature, configuration)); + } public static void registerConfiguredFeatures() { StalAlloys.LOGGER.debug("Registering configured features for " + StalAlloys.MOD_ID); diff --git a/src/main/java/net/stal/alloys/world/StalAlloysPlacedFeatures.java b/src/main/java/net/stal/alloys/world/StalAlloysPlacedFeatures.java index 602c377..e80a999 100644 --- a/src/main/java/net/stal/alloys/world/StalAlloysPlacedFeatures.java +++ b/src/main/java/net/stal/alloys/world/StalAlloysPlacedFeatures.java @@ -2,58 +2,57 @@ import java.util.List; -import net.minecraft.util.registry.RegistryEntry; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Identifier; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.gen.YOffset; +import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.PlacedFeature; -import net.minecraft.world.gen.feature.PlacedFeatures; import net.minecraft.world.gen.placementmodifier.*; +import net.stal.alloys.StalAlloys; public class StalAlloysPlacedFeatures { - // Steel - // public static final RegistryEntry STEEL_ORE_PLACED = PlacedFeatures.register("steel_ore_placed", - // StalAlloysConfiguredFeatures.STEEL_ORE, modifiersWithCount(9, - // HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(80)))); - - // public static final RegistryEntry NETHER_STEEL_ORE_PLACED = PlacedFeatures.register("netherrack_steel_ore_placed", - // StalAlloysConfiguredFeatures.NETHER_STEEL_ORE, modifiersWithCount(10, - // HeightRangePlacementModifier.uniform(YOffset.fixed(-80), YOffset.fixed(80)))); - - // public static final RegistryEntry END_STEEL_ORE_PLACED = PlacedFeatures.register("endstpne_steel_ore_placed", - // StalAlloysConfiguredFeatures.END_STEEL_ORE, modifiersWithCount(10, - // HeightRangePlacementModifier.uniform(YOffset.fixed(-80), YOffset.fixed(80)))); + public static final RegistryKey NICKEL_ORE_PLACED_KEY = registerKey("nickel_ore_placed"); + public static final RegistryKey NETHERRACK_NICKEL_ORE_PLACED_KEY = registerKey("netherrack_nickel_ore_placed"); + public static final RegistryKey NETHERRACK_CHROMIUM_ORE_PLACED_KEY = registerKey("netherrack_chromium_ore_placed"); + public static final RegistryKey DEEPSLATE_CARBON_ORE_PLACED_KEY = registerKey("deepslate_carbon_ore_placed"); + public static final RegistryKey ZINC_ORE_PLACED_KEY = registerKey("zinc_ore_placed"); + public static final RegistryKey TIN_ORE_PLACED_KEY = registerKey("tin_ore_placed"); - // Nickel - public static final RegistryEntry NICKEL_ORE_PLACED = PlacedFeatures.register("nickel_ore_placed", - StalAlloysConfiguredFeatures.NICKEL_ORE, modifiersWithCount(9, - HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(80)))); - public static final RegistryEntry NETHER_NICKEL_ORE_PLACED = PlacedFeatures.register("netherrack_nickel_ore_placed", - StalAlloysConfiguredFeatures.NETHER_NICKEL_ORE, modifiersWithCount(10, - HeightRangePlacementModifier.uniform(YOffset.fixed(-80), YOffset.fixed(80)))); + public static void bootstrap(Registerable context) { + var configuredFeatureRegistryEntryLookup = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE); - // Chromium - // public static final RegistryEntry CHROMIUM_ORE_PLACED = PlacedFeatures.register("chromium_ore_placed", - // StalAlloysConfiguredFeatures.CHROMIUM_ORE, modifiersWithCount(9, - // HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(80)))); - - public static final RegistryEntry NETHER_CHROMIUM_ORE_PLACED = PlacedFeatures.register("netherrack_chromium_ore_placed", - StalAlloysConfiguredFeatures.NETHER_CHROMIUM_ORE, modifiersWithCount(3, - HeightRangePlacementModifier.uniform(YOffset.fixed(-15), YOffset.fixed(22)))); + register(context, NICKEL_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.NICKEL_ORE_KEY), + modifiersWithCount(9, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80)))); + register(context, NETHERRACK_NICKEL_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.NETHERRACK_NICKEL_ORE_KEY), + modifiersWithCount(10, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80)))); + register(context, NETHERRACK_CHROMIUM_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.NETHERRACK_CHROMIUM_ORE_KEY), + modifiersWithCount(3, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-15), YOffset.aboveBottom(22)))); + register(context, DEEPSLATE_CARBON_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.DEEPSLATE_CARBON_ORE_KEY), + modifiersWithCount(6, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80)))); + register(context, ZINC_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.ZINC_ORE_KEY), + modifiersWithCount(9, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80)))); + register(context, TIN_ORE_PLACED_KEY, configuredFeatureRegistryEntryLookup.getOrThrow(StalAlloysConfiguredFeatures.TIN_ORE_KEY), + modifiersWithCount(9, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80)))); + } - // Carbon - public static final RegistryEntry CARBON_ORE_PLACED = PlacedFeatures.register("carbon_ore_placed", - StalAlloysConfiguredFeatures.CARBON_ORE, modifiersWithCount(6, - HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(0)))); + public static RegistryKey registerKey(String name) { + return RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(StalAlloys.MOD_ID, name)); + } - // Zinc - public static final RegistryEntry ZINC_ORE_PLACED = PlacedFeatures.register("zinc_ore_placed", - StalAlloysConfiguredFeatures.ZINC_ORE, modifiersWithCount(9, - HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(80)))); + private static void register(Registerable context, RegistryKey key, RegistryEntry> configuration, + List modifiers) { + context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); + } - // Tin - public static final RegistryEntry TIN_ORE_PLACED = PlacedFeatures.register("tin_ore_placed", - StalAlloysConfiguredFeatures.TIN_ORE, modifiersWithCount(9, - HeightRangePlacementModifier.trapezoid(YOffset.fixed(-80), YOffset.fixed(80)))); + // private static > void register(Registerable context, RegistryKey key, + // RegistryEntry> configuration, + // PlacementModifier... modifiers) { + // register(context, key, configuration, List.of(modifiers)); + // } private static List modifiers(PlacementModifier countModifier, PlacementModifier heightModifier) { return List.of(countModifier, SquarePlacementModifier.of(), heightModifier, BiomePlacementModifier.of()); diff --git a/src/main/java/net/stal/alloys/world/gen/StalAlloysOreGeneration.java b/src/main/java/net/stal/alloys/world/gen/StalAlloysOreGeneration.java index da612af..49d337c 100644 --- a/src/main/java/net/stal/alloys/world/gen/StalAlloysOreGeneration.java +++ b/src/main/java/net/stal/alloys/world/gen/StalAlloysOreGeneration.java @@ -7,26 +7,20 @@ public class StalAlloysOreGeneration { public static void generateOres() { - // Steel - // BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.STEEL_ORE_PLACED.getKey().get()); - // BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NETHER_STEEL_ORE_PLACED.getKey().get()); - // BiomeModifications.addFeature(BiomeSelectors.foundInTheEnd(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.END_STEEL_ORE_PLACED.getKey().get()); - // Nickel - BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NICKEL_ORE_PLACED.getKey().get()); - BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NETHER_NICKEL_ORE_PLACED.getKey().get()); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NICKEL_ORE_PLACED_KEY); + BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NETHERRACK_NICKEL_ORE_PLACED_KEY); // Chromium - // BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.CHROMIUM_ORE_PLACED.getKey().get()); - BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NETHER_CHROMIUM_ORE_PLACED.getKey().get()); + BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.NETHERRACK_CHROMIUM_ORE_PLACED_KEY); // Carbon - BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.CARBON_ORE_PLACED.getKey().get()); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.DEEPSLATE_CARBON_ORE_PLACED_KEY); // Zinc - BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.ZINC_ORE_PLACED.getKey().get()); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.ZINC_ORE_PLACED_KEY); // Tin - BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.TIN_ORE_PLACED.getKey().get()); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, StalAlloysPlacedFeatures.TIN_ORE_PLACED_KEY); } } diff --git a/src/main/resources/assets/stal-alloys/lang/en_us.json b/src/main/resources/assets/stal-alloys/lang/en_us.json index 4444f7c..78aea49 100644 --- a/src/main/resources/assets/stal-alloys/lang/en_us.json +++ b/src/main/resources/assets/stal-alloys/lang/en_us.json @@ -68,7 +68,7 @@ "container.stal-alloys.alloy_smelter" : "Alloy Smelter", - "itemGroup.stal-alloys.stal_alloys": "STAL Alloys", + "itemGroup.stal-alloys": "STAL Alloys", "key.category.stal-alloys.example": "Example Key Category", "key.stal-alloys.example": "Example Key Binding" diff --git a/src/main/resources/data/stal-alloys/loot_tables/blocks/deepslate_carbon_ore.json b/src/main/resources/data/stal-alloys/loot_tables/blocks/deepslate_carbon_ore.json index 7266c45..18c3159 100644 --- a/src/main/resources/data/stal-alloys/loot_tables/blocks/deepslate_carbon_ore.json +++ b/src/main/resources/data/stal-alloys/loot_tables/blocks/deepslate_carbon_ore.json @@ -33,7 +33,7 @@ "add": false, "count": { "type": "minecraft:uniform", - "max": 6.0, + "max": 4.0, "min": 2.0 }, "function": "minecraft:set_count" diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/deepslate_carbon_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/deepslate_carbon_ore.json new file mode 100644 index 0000000..47c250f --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/deepslate_carbon_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 8, + "targets": [ + { + "state": { + "Name": "stal-alloys:deepslate_carbon_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_chromium_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_chromium_ore.json new file mode 100644 index 0000000..c40d883 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_chromium_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 4, + "targets": [ + { + "state": { + "Name": "stal-alloys:netherrack_chromium_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_nether" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_nickel_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_nickel_ore.json new file mode 100644 index 0000000..a023875 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/netherrack_nickel_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 12, + "targets": [ + { + "state": { + "Name": "stal-alloys:netherrack_nickel_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_nether" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/nickel_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/nickel_ore.json new file mode 100644 index 0000000..051cead --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/nickel_ore.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 12, + "targets": [ + { + "state": { + "Name": "stal-alloys:nickel_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "stal-alloys:deepslate_nickel_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/tin_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/tin_ore.json new file mode 100644 index 0000000..d799ac9 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/tin_ore.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 9, + "targets": [ + { + "state": { + "Name": "stal-alloys:tin_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "stal-alloys:deepslate_tin_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/configured_feature/zinc_ore.json b/src/main/resources/data/stal-alloys/worldgen/configured_feature/zinc_ore.json new file mode 100644 index 0000000..e78bb6e --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/configured_feature/zinc_ore.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 9, + "targets": [ + { + "state": { + "Name": "stal-alloys:zinc_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "stal-alloys:deepslate_zinc_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/deepslate_carbon_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/deepslate_carbon_ore_placed.json new file mode 100644 index 0000000..bbdfa99 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/deepslate_carbon_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:deepslate_carbon_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 6 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_chromium_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_chromium_ore_placed.json new file mode 100644 index 0000000..6f6465e --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_chromium_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:netherrack_chromium_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 3 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 22 + }, + "min_inclusive": { + "above_bottom": -15 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_nickel_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_nickel_ore_placed.json new file mode 100644 index 0000000..29eba15 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/netherrack_nickel_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:netherrack_nickel_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 10 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/nickel_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/nickel_ore_placed.json new file mode 100644 index 0000000..9431d70 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/nickel_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:nickel_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 9 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/tin_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/tin_ore_placed.json new file mode 100644 index 0000000..8201e1f --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/tin_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:tin_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 9 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/stal-alloys/worldgen/placed_feature/zinc_ore_placed.json b/src/main/resources/data/stal-alloys/worldgen/placed_feature/zinc_ore_placed.json new file mode 100644 index 0000000..0f85836 --- /dev/null +++ b/src/main/resources/data/stal-alloys/worldgen/placed_feature/zinc_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "stal-alloys:zinc_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 9 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file