Data gen alloy smelter recipes

This commit is contained in:
modmuss50 2023-01-23 15:05:45 +00:00
parent 3982da5c63
commit 0f8d3a8ccc
10 changed files with 246 additions and 103 deletions

View file

@ -0,0 +1,157 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.datagen
import net.minecraft.item.Item
import net.minecraft.registry.RegistryKeys
import net.minecraft.registry.tag.TagKey
import net.minecraft.util.Identifier
class TRConventionalTags {
public static final TagKey<Item> ADVANCED_ALLOY_BLOCKS = register("advanced_alloy_blocks")
public static final TagKey<Item> ADVANCED_ALLOY_INGOTS = register("advanced_alloy_ingots")
public static final TagKey<Item> ALUMINUM_BLOCKS = register("aluminum_blocks")
public static final TagKey<Item> ALUMINUM_DUSTS = register("aluminum_dusts")
public static final TagKey<Item> ALUMINUM_INGOTS = register("aluminum_ingots")
public static final TagKey<Item> ALUMINUM_PLATES = register("aluminum_plates")
public static final TagKey<Item> AMETHYST_DUSTS = register("amethyst_dusts")
public static final TagKey<Item> BASALT = register("basalt")
public static final TagKey<Item> BAUXITE_DUSTS = register("bauxite_dusts")
public static final TagKey<Item> BAUXITE_ORES = register("bauxite_ores")
public static final TagKey<Item> BRASS_BLOCKS = register("brass_blocks")
public static final TagKey<Item> BRASS_DUSTS = register("brass_dusts")
public static final TagKey<Item> BRASS_INGOTS = register("brass_ingots")
public static final TagKey<Item> BRONZE_BLOCKS = register("bronze_blocks")
public static final TagKey<Item> BRONZE_INGOTS = register("bronze_ingots")
public static final TagKey<Item> CALCITE_DUSTS = register("calcite_dusts")
public static final TagKey<Item> CALCITE_SMALL_DUSTS = register("calcite_small_dusts")
public static final TagKey<Item> CHROMIUM_BLOCKS = register("chromium_blocks")
public static final TagKey<Item> CHROMIUM_INGOTS = register("chromium_ingots")
public static final TagKey<Item> CINNABAR_ORES = register("cinnabar_ores")
public static final TagKey<Item> COAL_DUSTS = register("coal_dusts")
public static final TagKey<Item> COAL_ORES = register("coal_ores")
public static final TagKey<Item> COOKED_MEAT = register("cooked_meat")
public static final TagKey<Item> COPPER_ORES = register("copper_ores")
public static final TagKey<Item> COPPER_PLATES = register("copper_plates")
public static final TagKey<Item> DEAD_CORAL_BLOCKS = register("dead_coral_blocks")
public static final TagKey<Item> DIAMOND_DUSTS = register("diamond_dusts")
public static final TagKey<Item> DIAMOND_ORES = register("diamond_ores")
public static final TagKey<Item> ELECTRUM_BLOCKS = register("electrum_blocks")
public static final TagKey<Item> ELECTRUM_DUSTS = register("electrum_dusts")
public static final TagKey<Item> ELECTRUM_INGOTS = register("electrum_ingots")
public static final TagKey<Item> ELECTRUM_PLATES = register("electrum_plates")
public static final TagKey<Item> EMERALD_DUSTS = register("emerald_dusts")
public static final TagKey<Item> EMERALD_ORES = register("emerald_ores")
public static final TagKey<Item> EMERALD_PLATES = register("emerald_plates")
public static final TagKey<Item> ENDER_PEARL_DUSTS = register("ender_pearl_dusts")
public static final TagKey<Item> FROGLIGHTS = register("froglights")
public static final TagKey<Item> GALENA_ORES = register("galena_ores")
public static final TagKey<Item> GLOWSTONE_SMALL_DUSTS = register("glowstone_small_dusts")
public static final TagKey<Item> GOLD_ORES = register("gold_ores")
public static final TagKey<Item> INVAR_BLOCKS = register("invar_blocks")
public static final TagKey<Item> INVAR_INGOTS = register("invar_ingots")
public static final TagKey<Item> IRIDIUM_BLOCKS = register("iridium_blocks")
public static final TagKey<Item> IRIDIUM_INGOTS = register("iridium_ingots")
public static final TagKey<Item> IRIDIUM_ORES = register("iridium_ores")
public static final TagKey<Item> IRON_ORES = register("iron_ores")
public static final TagKey<Item> LAPIS_ORES = register("lapis_ores")
public static final TagKey<Item> LAZURITE_DUSTS = register("lazurite_dusts")
public static final TagKey<Item> LEAD_BLOCKS = register("lead_blocks")
public static final TagKey<Item> LEAD_INGOTS = register("lead_ingots")
public static final TagKey<Item> LEAD_ORES = register("lead_ores")
public static final TagKey<Item> NETHERITE_NUGGETS = register("netherite_nuggets")
public static final TagKey<Item> NICKEL_BLOCKS = register("nickel_blocks")
public static final TagKey<Item> NICKEL_INGOTS = register("nickel_ingots")
public static final TagKey<Item> OBSIDIAN_DUSTS = register("obsidian_dusts")
public static final TagKey<Item> PERIDOT_BLOCKS = register("peridot_blocks")
public static final TagKey<Item> PERIDOT_DUSTS = register("peridot_dusts")
public static final TagKey<Item> PERIDOT_GEMS = register("peridot_gems")
public static final TagKey<Item> PERIDOT_ORES = register("peridot_ores")
public static final TagKey<Item> PERIDOT_PLATES = register("peridot_plates")
public static final TagKey<Item> PLATINUM_BLOCKS = register("platinum_blocks")
public static final TagKey<Item> PLATINUM_DUSTS = register("platinum_dusts")
public static final TagKey<Item> PLATINUM_INGOTS = register("platinum_ingots")
public static final TagKey<Item> PLATINUM_PLATES = register("platinum_plates")
public static final TagKey<Item> PYRITE_ORES = register("pyrite_ores")
public static final TagKey<Item> QUARTZ_DUSTS = register("quartz_dusts")
public static final TagKey<Item> RAW_LEAD_ORES = register("raw_lead_ores")
public static final TagKey<Item> RAW_MEAT = register("raw_meat")
public static final TagKey<Item> RAW_SILVER_ORES = register("raw_silver_ores")
public static final TagKey<Item> RAW_TIN_ORES = register("raw_tin_ores")
public static final TagKey<Item> RAW_TUNGSTEN_ORES = register("raw_tungsten_ores")
public static final TagKey<Item> RED_GARNET_BLOCKS = register("red_garnet_blocks")
public static final TagKey<Item> RED_GARNET_DUSTS = register("red_garnet_dusts")
public static final TagKey<Item> RED_GARNET_GEMS = register("red_garnet_gems")
public static final TagKey<Item> REDSTONE_ORES = register("redstone_ores")
public static final TagKey<Item> REFINED_IRON_BLOCKS = register("refined_iron_blocks")
public static final TagKey<Item> REFINED_IRON_INGOTS = register("refined_iron_ingots")
public static final TagKey<Item> RUBIES = register("rubies")
public static final TagKey<Item> RUBY_BLOCKS = register("ruby_blocks")
public static final TagKey<Item> RUBY_DUSTS = register("ruby_dusts")
public static final TagKey<Item> RUBY_ORES = register("ruby_ores")
public static final TagKey<Item> SAPPHIRE_BLOCKS = register("sapphire_blocks")
public static final TagKey<Item> SAPPHIRE_DUSTS = register("sapphire_dusts")
public static final TagKey<Item> SAPPHIRE_ORES = register("sapphire_ores")
public static final TagKey<Item> SAPPHIRES = register("sapphires")
public static final TagKey<Item> SAW_DUSTS = register("saw_dusts")
public static final TagKey<Item> SHELDONITE_ORES = register("sheldonite_ores")
public static final TagKey<Item> SILICON_PLATES = register("silicon_plates")
public static final TagKey<Item> SILVER_BLOCKS = register("silver_blocks")
public static final TagKey<Item> SILVER_INGOTS = register("silver_ingots")
public static final TagKey<Item> SILVER_ORES = register("silver_ores")
public static final TagKey<Item> SMALL_CORALS_BLUE = register("small_corals_blue")
public static final TagKey<Item> SMALL_CORALS_DEAD = register("small_corals_dead")
public static final TagKey<Item> SMALL_CORALS_PINK = register("small_corals_pink")
public static final TagKey<Item> SMALL_CORALS_PURPLE = register("small_corals_purple")
public static final TagKey<Item> SMALL_CORALS_RED = register("small_corals_red")
public static final TagKey<Item> SMALL_CORALS_YELLOW = register("small_corals_yellow")
public static final TagKey<Item> SODALITE_ORES = register("sodalite_ores")
public static final TagKey<Item> SPHALERITE_ORES = register("sphalerite_ores")
public static final TagKey<Item> SPONGES = register("sponges")
public static final TagKey<Item> STEEL_BLOCKS = register("steel_blocks")
public static final TagKey<Item> STEEL_DUSTS = register("steel_dusts")
public static final TagKey<Item> STEEL_INGOTS = register("steel_ingots")
public static final TagKey<Item> TIN_BLOCKS = register("tin_blocks")
public static final TagKey<Item> TIN_INGOTS = register("tin_ingots")
public static final TagKey<Item> TIN_ORES = register("tin_ores")
public static final TagKey<Item> TITANIUM_BLOCKS = register("titanium_blocks")
public static final TagKey<Item> TITANIUM_DUSTS = register("titanium_dusts")
public static final TagKey<Item> TITANIUM_INGOTS = register("titanium_ingots")
public static final TagKey<Item> TUNGSTEN_BLOCKS = register("tungsten_blocks")
public static final TagKey<Item> TUNGSTEN_INGOTS = register("tungsten_ingots")
public static final TagKey<Item> TUNGSTEN_ORES = register("tungsten_ores")
public static final TagKey<Item> TUNGSTENSTEEL_BLOCKS = register("tungstensteel_blocks")
public static final TagKey<Item> TUNGSTENSTEEL_INGOTS = register("tungstensteel_ingots")
public static final TagKey<Item> YELLOW_GARNET_BLOCKS = register("yellow_garnet_blocks")
public static final TagKey<Item> YELLOW_GARNET_DUSTS = register("yellow_garnet_dusts")
public static final TagKey<Item> YELLOW_GARNET_GEMS = register("yellow_garnet_gems")
public static final TagKey<Item> ZINC_BLOCKS = register("zinc_blocks")
public static final TagKey<Item> ZINC_DUSTS = register("zinc_dusts")
public static final TagKey<Item> ZINC_INGOTS = register("zinc_ingots")
private static TagKey<Item> register(String name) {
return TagKey.of(RegistryKeys.ITEM, new Identifier("c", name))
}
}

View file

@ -32,6 +32,7 @@ import techreborn.TechReborn
import techreborn.datagen.models.BlockLootTableProvider
import techreborn.datagen.models.ModelProvider
import techreborn.datagen.recipes.crafting.CraftingRecipesProvider
import techreborn.datagen.recipes.machine.alloy_smelter.AlloySmelterRecipesProvider
import techreborn.datagen.recipes.machine.assembling_machine.AssemblingMachineRecipesProvider
import techreborn.datagen.recipes.machine.blast_furnace.BlastFurnaceRecipesProvider
import techreborn.datagen.recipes.machine.chemical_reactor.ChemicalReactorRecipesProvider
@ -73,6 +74,7 @@ class TechRebornDataGen implements DataGeneratorEntrypoint {
add BlastFurnaceRecipesProvider::new
add IndustrialGrinderRecipesProvider::new
add IndustrialSawmillRecipesProvider::new
add AlloySmelterRecipesProvider::new
add ModelProvider::new
add BlockLootTableProvider::new

View file

@ -127,6 +127,10 @@ abstract class TechRebornRecipesProvider extends FabricRecipeProvider {
throw new IllegalArgumentException()
}
def offerAlloySmelterRecipe(@DelegatesTo(value = MachineRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
MachineRecipeJsonFactory.create(ModRecipes.ALLOY_SMELTER, closure).offerTo(exporter)
}
def offerGrinderRecipe(@DelegatesTo(value = MachineRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
MachineRecipeJsonFactory.create(ModRecipes.GRINDER, closure).offerTo(exporter)
}

View file

@ -0,0 +1,79 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.datagen.recipes.machine.alloy_smelter
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.registry.RegistryWrapper
import techreborn.datagen.TRConventionalTags
import techreborn.datagen.recipes.TechRebornRecipesProvider
import techreborn.init.TRContent
import java.util.concurrent.CompletableFuture
class AlloySmelterRecipesProvider extends TechRebornRecipesProvider {
AlloySmelterRecipesProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
super(output, registriesFuture)
}
@Override
void generateRecipes() {
offerAlloySmelterRecipe {
power 6
time 200
ingredients new ItemStack(Items.COPPER_INGOT, 3), TRConventionalTags.ZINC_INGOTS
output new ItemStack(TRContent.Ingots.BRASS, 4)
}
offerAlloySmelterRecipe {
power 6
time 200
ingredients new ItemStack(Items.COPPER_INGOT, 3), TRConventionalTags.TIN_INGOTS
output new ItemStack(TRContent.Ingots.BRONZE, 4)
}
offerAlloySmelterRecipe {
power 6
time 200
ingredients Items.GOLD_INGOT, TRConventionalTags.SILVER_INGOTS
output new ItemStack(TRContent.Ingots.ELECTRUM, 2)
}
offerAlloySmelterRecipe {
power 6
time 200
ingredients new ItemStack(Items.IRON_INGOT, 3), TRConventionalTags.NICKEL_INGOTS
output new ItemStack(TRContent.Ingots.INVAR, 3)
}
offerAlloySmelterRecipe {
power 6
time 600
ingredients new ItemStack(Items.GOLD_INGOT, 10), new ItemStack(Items.NETHERITE_SCRAP, 10)
output new ItemStack(Items.NETHERITE_INGOT, 3)
}
}
}

View file

@ -33,6 +33,7 @@ import net.minecraft.registry.RegistryWrapper
import net.minecraft.registry.tag.ItemTags
import net.minecraft.registry.tag.TagKey
import net.minecraft.util.Identifier
import techreborn.datagen.TRConventionalTags
import techreborn.datagen.recipes.TechRebornRecipesProvider
import techreborn.init.TRContent
@ -61,9 +62,9 @@ class GrinderRecipesProvider extends TechRebornRecipesProvider {
void generateVanillaRawMetals() {
[
(Items.RAW_IRON) : (TagKey.of(RegistryKeys.ITEM, new Identifier("c", "iron_ores"))),
(Items.RAW_COPPER): (TagKey.of(RegistryKeys.ITEM, new Identifier("c", "copper_ores"))),
(Items.RAW_GOLD) : (TagKey.of(RegistryKeys.ITEM, new Identifier("c", "gold_ores")))
(Items.RAW_IRON) : (TRConventionalTags.IRON_ORES),
(Items.RAW_COPPER): (TRConventionalTags.COPPER_ORES),
(Items.RAW_GOLD) : (TRConventionalTags.GOLD_ORES)
].each { raw, oreTag ->
offerGrinderRecipe {
ingredients oreTag

View file

@ -1,20 +0,0 @@
{
"type": "techreborn:alloy_smelter",
"power": 6,
"time": 200,
"ingredients": [
{
"count": 3,
"item": "minecraft:copper_ingot"
},
{
"tag": "c:zinc_ingots"
}
],
"results": [
{
"item": "techreborn:brass_ingot",
"count": 4
}
]
}

View file

@ -1,20 +0,0 @@
{
"type": "techreborn:alloy_smelter",
"power": 6,
"time": 200,
"ingredients": [
{
"tag": "c:tin_ingots"
},
{
"count": 3,
"item": "minecraft:copper_ingot"
}
],
"results": [
{
"item": "techreborn:bronze_ingot",
"count": 4
}
]
}

View file

@ -1,19 +0,0 @@
{
"type": "techreborn:alloy_smelter",
"power": 6,
"time": 200,
"ingredients": [
{
"item": "minecraft:gold_ingot"
},
{
"tag": "c:silver_ingots"
}
],
"results": [
{
"item": "techreborn:electrum_ingot",
"count": 2
}
]
}

View file

@ -1,20 +0,0 @@
{
"type": "techreborn:alloy_smelter",
"power": 6,
"time": 200,
"ingredients" : [
{
"item": "minecraft:iron_ingot",
"count": 2
},
{
"tag": "c:nickel_ingots"
}
],
"results" : [
{
"item": "techreborn:invar_ingot",
"count": 3
}
]
}

View file

@ -1,21 +0,0 @@
{
"type": "techreborn:alloy_smelter",
"power": 6,
"time": 600,
"ingredients" : [
{
"item": "minecraft:gold_ingot",
"count": 10
},
{
"item": "minecraft:netherite_scrap",
"count": 10
}
],
"results" : [
{
"item": "minecraft:netherite_ingot",
"count": 3
}
]
}