Skip to content

Commit

Permalink
New recipes (#2917)
Browse files Browse the repository at this point in the history
* Added assembling colored beds via machine

* Added pufferfish extraction for sponge piece.

Including toast and also added missing toast for sponge piece (see #2883)

* Added painting tool -> 1 string extraction

* Added sticky piston -> slime ball extraction

* Improved two recipe names incl. toasts

* Added smelting glass panes back to glass

* Added anvil uncrafting

* Added bow/crossbow -> String via extraction

* Added cobble->black & bars->ingot blast furnace recipes
  • Loading branch information
Ayutac committed Apr 28, 2022
1 parent deef1f3 commit 1fc34f1
Show file tree
Hide file tree
Showing 25 changed files with 504 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package techreborn.datagen

import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
import techreborn.datagen.recipes.machine.assembling_machine.AssemblingMachineRecipesProvider
import techreborn.datagen.recipes.machine.blast_furnace.BlastFurnaceRecipesProvider
import techreborn.datagen.recipes.machine.chemical_reactor.ChemicalReactorRecipesProvider
import techreborn.datagen.recipes.machine.compressor.CompressorRecipesProvider
Expand Down Expand Up @@ -54,6 +55,7 @@ class TechRebornDataGen implements DataGeneratorEntrypoint {
fabricDataGenerator.addProvider(CompressorRecipesProvider.&new)
fabricDataGenerator.addProvider(ExtractorRecipesProvider.&new)
fabricDataGenerator.addProvider(ChemicalReactorRecipesProvider.&new)
fabricDataGenerator.addProvider(AssemblingMachineRecipesProvider.&new)
fabricDataGenerator.addProvider(BlastFurnaceRecipesProvider.&new)
fabricDataGenerator.addProvider(IndustrialGrinderRecipesProvider.&new)
fabricDataGenerator.addProvider(IndustrialSawmillRecipesProvider.&new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ abstract class TechRebornRecipesProvider extends FabricRecipeProvider {
MachineRecipeJsonFactory.create(ModRecipes.CHEMICAL_REACTOR, closure).offerTo(exporter)
}

def offerAssemblingMachineRecipe(@DelegatesTo(value = MachineRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
MachineRecipeJsonFactory.create(ModRecipes.ASSEMBLING_MACHINE, closure).offerTo(exporter)
}

def offerBlastFurnaceRecipe(@DelegatesTo(value = BlastFurnaceRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
BlastFurnaceRecipeJsonFactory.createBlastFurnace(closure).offerTo(exporter)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import net.minecraft.advancement.criterion.CriterionConditions
import net.minecraft.data.server.recipe.RecipeJsonProvider
import net.minecraft.item.ItemConvertible
import net.minecraft.item.ItemStack
import net.minecraft.recipe.Ingredient
import net.minecraft.recipe.RecipeSerializer
import net.minecraft.tag.TagKey
import net.minecraft.util.Identifier
Expand Down Expand Up @@ -82,6 +83,7 @@ class MachineRecipeJsonFactory<R extends RebornRecipe> {
ingredient {
stack object
}

} else {
throw new IllegalArgumentException()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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.assembling_machine

import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.tag.ItemTags
import techreborn.datagen.recipes.TechRebornRecipesProvider

class AssemblingMachineRecipesProvider extends TechRebornRecipesProvider {

AssemblingMachineRecipesProvider(FabricDataGenerator dataGenerator) {
super(dataGenerator)
}

@Override
void generateRecipes() {
generateBed()
}

void generateBed() {
[
(Items.BLACK_WOOL): Items.BLACK_BED,
(Items.BLUE_WOOL): Items.BLUE_BED,
(Items.BROWN_WOOL): Items.BROWN_BED,
(Items.CYAN_WOOL): Items.CYAN_BED,
(Items.GRAY_WOOL): Items.GRAY_BED,
(Items.GREEN_WOOL): Items.GREEN_BED,
(Items.LIGHT_BLUE_WOOL): Items.LIGHT_BLUE_BED,
(Items.LIGHT_GRAY_WOOL): Items.LIGHT_GRAY_BED,
(Items.LIME_WOOL): Items.LIME_BED,
(Items.MAGENTA_WOOL): Items.MAGENTA_BED,
(Items.ORANGE_WOOL): Items.ORANGE_BED,
(Items.PINK_WOOL): Items.PINK_BED,
(Items.PURPLE_WOOL): Items.PURPLE_BED,
(Items.RED_WOOL): Items.RED_BED,
(Items.WHITE_DYE): Items.WHITE_BED,
(Items.YELLOW_DYE): Items.YELLOW_BED
].each {(wool, bed) ->
offerAssemblingMachineRecipe {
ingredients new ItemStack(wool, 2), ItemTags.PLANKS
output bed
source "wool"
power 25
time 250
criterion getCriterionName(wool), getCriterionConditions(wool)
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class BlastFurnaceRecipesProvider extends TechRebornRecipesProvider {
generateHoe()
generateAxe()
generatePickaxe()
generateGlassFromGlassPane()
generateAnvil()
}

void generateBoots() {
Expand Down Expand Up @@ -253,4 +255,54 @@ class BlastFurnaceRecipesProvider extends TechRebornRecipesProvider {
}
}
}

void generateGlassFromGlassPane() {
[
(Items.GLASS_PANE) : Items.GLASS,
(Items.BLACK_STAINED_GLASS_PANE) : Items.BLACK_STAINED_GLASS,
(Items.BLUE_STAINED_GLASS_PANE) : Items.BLACK_STAINED_GLASS,
(Items.BROWN_STAINED_GLASS_PANE) : Items.BROWN_STAINED_GLASS,
(Items.CYAN_STAINED_GLASS_PANE) : Items.CYAN_STAINED_GLASS,
(Items.GRAY_STAINED_GLASS_PANE) : Items.GRAY_STAINED_GLASS,
(Items.GREEN_STAINED_GLASS_PANE) : Items.GREEN_STAINED_GLASS,
(Items.LIGHT_BLUE_STAINED_GLASS_PANE) : Items.LIGHT_BLUE_STAINED_GLASS,
(Items.LIGHT_GRAY_STAINED_GLASS_PANE) : Items.LIGHT_GRAY_STAINED_GLASS,
(Items.LIME_STAINED_GLASS_PANE) : Items.LIME_STAINED_GLASS,
(Items.MAGENTA_STAINED_GLASS_PANE) : Items.MAGENTA_STAINED_GLASS,
(Items.ORANGE_STAINED_GLASS_PANE) : Items.ORANGE_STAINED_GLASS,
(Items.PINK_STAINED_GLASS_PANE) : Items.PINK_STAINED_GLASS,
(Items.PURPLE_STAINED_GLASS_PANE) : Items.PURPLE_STAINED_GLASS,
(Items.RED_STAINED_GLASS_PANE) : Items.RED_STAINED_GLASS,
(Items.WHITE_STAINED_GLASS_PANE) : Items.WHITE_STAINED_GLASS,
(Items.YELLOW_STAINED_GLASS_PANE) : Items.YELLOW_STAINED_GLASS
].each {(pane,glass) ->
offerBlastFurnaceRecipe {
ingredients new ItemStack(pane, 10)
outputs new ItemStack(glass, 3)
power 128
time 150
heat 1000
source "glass_pane"
criterion getCriterionName(pane), getCriterionConditions(pane)
}
}
}

void generateAnvil() {
[
(Items.ANVIL) : 12,
(Items.CHIPPED_ANVIL) : 9,
(Items.DAMAGED_ANVIL) : 6,
].each {(anvil,amount) ->
offerBlastFurnaceRecipe {
ingredients anvil, new ItemStack(Items.SAND, 2)
outputs new ItemStack(Items.IRON_INGOT, amount), new ItemStack(TRContent.Dusts.DARK_ASHES, 2)
power 128
time 300
heat 1500
source "anvil_gives_"+amount
criterion getCriterionName(anvil), getCriterionConditions(anvil)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:blast_furnace/blackstone"
]
},
"criteria": {
"has_cobblestone": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:cobblestone"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:blast_furnace/blackstone"
}
}
},
"requirements": [
[
"has_cobblestone",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:blast_furnace/iron_ingot"
]
},
"criteria": {
"has_iron_bars": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:iron_bars"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:blast_furnace/iron_ingot"
}
}
},
"requirements": [
[
"has_iron_bars",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/slime_ball_from_sticky_piston"
]
},
"criteria": {
"has_sticky_piston": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:sticky_piston"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/slime_ball_from_sticky_piston"
}
}
},
"requirements": [
[
"has_sticky_piston",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/sponge_piece_from_cod"
]
},
"criteria": {
"has_cod": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:cod"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/sponge_piece_from_cod"
}
}
},
"requirements": [
[
"has_cod",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/sponge_piece_from_pufferfish"
]
},
"criteria": {
"has_pufferfish": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:pufferfish"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/sponge_piece_from_pufferfish"
}
}
},
"requirements": [
[
"has_pufferfish",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/sticks_from_armor_stand"
"techreborn:extractor/stick_from_armor_stand"
]
},
"criteria": {
Expand All @@ -19,7 +19,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/sticks_from_armor_stand"
"recipe": "techreborn:extractor/stick_from_armor_stand"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/stick"
"techreborn:extractor/stick_from_dead_bush"
]
},
"criteria": {
Expand All @@ -19,7 +19,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/stick"
"recipe": "techreborn:extractor/stick_from_dead_bush"
}
}
},
Expand Down

0 comments on commit 1fc34f1

Please sign in to comment.