Datagen'd the vanilla dye recipes. Thanks to Ayutac.

Notably also added the extractor recipes for Cornflower, Lapis Lazuli, Cocoa Beans, Bone Meal and Lily of the Valley, hence implementing #2789
This commit is contained in:
Ayutac 2022-04-01 08:55:09 +02:00 committed by GitHub
parent 5dbad187ef
commit 07e8ddf172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 104 additions and 736 deletions

View file

@ -29,6 +29,7 @@ import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
import techreborn.datagen.recipes.machine.blast_furnace.BlastFurnaceRecipesProvider
import techreborn.datagen.recipes.machine.chemical_reactor.ChemicalReactorRecipesProvider
import techreborn.datagen.recipes.machine.compressor.CompressorRecipesProvider
import techreborn.datagen.recipes.machine.extractor.ExtractorRecipesProvider
import techreborn.datagen.recipes.machine.grinder.GrinderRecipesProvider
import techreborn.datagen.recipes.machine.industrial_sawmill.IndustrialSawmillRecipesProvider
import techreborn.datagen.recipes.smelting.SmeltingRecipesProvider
@ -50,6 +51,7 @@ class TechRebornDataGen implements DataGeneratorEntrypoint {
fabricDataGenerator.addProvider(GrinderRecipesProvider.&new)
fabricDataGenerator.addProvider(CompressorRecipesProvider.&new)
fabricDataGenerator.addProvider(ExtractorRecipesProvider.&new)
fabricDataGenerator.addProvider(ChemicalReactorRecipesProvider.&new)
fabricDataGenerator.addProvider(BlastFurnaceRecipesProvider.&new)
fabricDataGenerator.addProvider(IndustrialSawmillRecipesProvider.&new)

View file

@ -131,6 +131,10 @@ abstract class TechRebornRecipesProvider extends FabricRecipeProvider {
MachineRecipeJsonFactory.create(ModRecipes.COMPRESSOR, closure).offerTo(exporter)
}
def offerExtractorRecipe(@DelegatesTo(value = MachineRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
MachineRecipeJsonFactory.create(ModRecipes.EXTRACTOR, closure).offerTo(exporter)
}
def offerChemicalReactorRecipe(@DelegatesTo(value = MachineRecipeJsonFactory.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
MachineRecipeJsonFactory.create(ModRecipes.CHEMICAL_REACTOR, closure).offerTo(exporter)
}

View file

@ -0,0 +1,98 @@
/*
* 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.extractor
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.tag.TagKey
import net.minecraft.util.Identifier
import net.minecraft.util.registry.Registry
import techreborn.datagen.recipes.TechRebornRecipesProvider
import techreborn.init.TRContent
class ExtractorRecipesProvider extends TechRebornRecipesProvider {
ExtractorRecipesProvider(FabricDataGenerator dataGenerator) {
super(dataGenerator)
}
@Override
void generateRecipes() {
generateDoubleDyes()
generateQuadrupleDyes()
}
// ONLY for doubling vanilla single dye recipes
void generateDoubleDyes() {
[
(Items.INK_SAC) : Items.BLACK_DYE,
(Items.WITHER_ROSE) : Items.BLACK_DYE,
(Items.CORNFLOWER) : Items.BLUE_DYE,
(Items.LAPIS_LAZULI) : Items.BLUE_DYE,
(Items.COCOA_BEANS) : Items.BROWN_DYE,
(Items.BLUE_ORCHID) : Items.LIGHT_BLUE_DYE,
(Items.AZURE_BLUET) : Items.LIGHT_GRAY_DYE,
(Items.OXEYE_DAISY) : Items.LIGHT_GRAY_DYE,
(Items.WHITE_TULIP) : Items.LIGHT_GRAY_DYE,
(Items.ALLIUM) : Items.MAGENTA_DYE,
(Items.ORANGE_TULIP) : Items.ORANGE_TULIP,
(Items.PINK_TULIP) : Items.PINK_DYE,
(Items.POPPY) : Items.RED_DYE,
(Items.RED_TULIP) : Items.RED_DYE,
(Items.BONE_MEAL) : Items.WHITE_DYE,
(Items.LILY_OF_THE_VALLEY) : Items.WHITE_DYE,
(Items.DANDELION) : Items.YELLOW_DYE
].each { item, dye ->
offerExtractorRecipe {
ingredients item
outputs new ItemStack(dye, 2)
source item.toString()
power 10
time 300
criterion getCriterionName(item), getCriterionConditions(item)
}
}
}
// ONLY for double vanilla double dye recipes
void generateQuadrupleDyes() {
[
(Items.LILAC) : Items.MAGENTA_DYE,
(Items.PEONY) : Items.PINK_DYE,
(Items.ROSE_BUSH) : Items.RED_DYE,
(Items.SUNFLOWER) : Items.YELLOW_DYE
].each { item, dye ->
offerExtractorRecipe {
ingredients item
outputs new ItemStack(dye, 4)
source item.toString()
power 10
time 300
criterion getCriterionName(item), getCriterionConditions(item)
}
}
}
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/black_dye"
]
},
"criteria": {
"has_ink_sac": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:ink_sac"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/black_dye"
}
}
},
"requirements": [
[
"has_ink_sac",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/light_blue_dye"
]
},
"criteria": {
"has_blue_orchid": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:blue_orchid"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/light_blue_dye"
}
}
},
"requirements": [
[
"has_blue_orchid",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/light_gray_dye_from_bluet"
]
},
"criteria": {
"has_azure_bluet": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:azure_bluet"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/light_gray_dye_from_bluet"
}
}
},
"requirements": [
[
"has_azure_bluet",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/light_gray_dye_from_daisy"
]
},
"criteria": {
"has_oxeye_daisy": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:oxeye_daisy"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/light_gray_dye_from_daisy"
}
}
},
"requirements": [
[
"has_oxeye_daisy",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/light_gray_dye_from_tulip"
]
},
"criteria": {
"has_white_tulip": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:white_tulip"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/light_gray_dye_from_tulip"
}
}
},
"requirements": [
[
"has_white_tulip",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/magenta_dye_from_allium"
]
},
"criteria": {
"has_allium": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:allium"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/magenta_dye_from_allium"
}
}
},
"requirements": [
[
"has_allium",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/magenta_dye_from_lilac"
]
},
"criteria": {
"has_lilac": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:lilac"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/magenta_dye_from_lilac"
}
}
},
"requirements": [
[
"has_lilac",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/orange_dye"
]
},
"criteria": {
"has_orange_tulip": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:orange_tulip"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/orange_dye"
}
}
},
"requirements": [
[
"has_orange_tulip",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/pink_dye_from_peony"
]
},
"criteria": {
"has_peony": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:peony"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/pink_dye_from_peony"
}
}
},
"requirements": [
[
"has_peony",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/pink_dye_from_tulip"
]
},
"criteria": {
"has_pink_tulip": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:pink_tulip"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/pink_dye_from_tulip"
}
}
},
"requirements": [
[
"has_pink_tulip",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/red_dye_from_poppy"
]
},
"criteria": {
"has_poppy": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:poppy"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/red_dye_from_poppy"
}
}
},
"requirements": [
[
"has_poppy",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/red_dye_from_rose"
]
},
"criteria": {
"has_rose_bush": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:rose_bush"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/red_dye_from_rose"
}
}
},
"requirements": [
[
"has_rose_bush",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/red_dye_from_tulip"
]
},
"criteria": {
"has_red_tulip": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:red_tulip"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/red_dye_from_tulip"
}
}
},
"requirements": [
[
"has_red_tulip",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/yellow_dye_from_dandelion"
]
},
"criteria": {
"has_dandelion": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:dandelion"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/yellow_dye_from_dandelion"
}
}
},
"requirements": [
[
"has_dandelion",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:extractor/yellow_dye_from_sunflower"
]
},
"criteria": {
"has_sunflower": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["minecraft:sunflower"]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:extractor/yellow_dye_from_sunflower"
}
}
},
"requirements": [
[
"has_sunflower",
"has_the_recipe"
]
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:ink_sac"
}
],
"results": [
{
"item": "minecraft:black_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:wither_rose"
}
],
"results": [
{
"item": "minecraft:black_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:blue_orchid"
}
],
"results": [
{
"item": "minecraft:light_blue_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:azure_bluet"
}
],
"results": [
{
"item": "minecraft:light_gray_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:oxeye_daisy"
}
],
"results": [
{
"item": "minecraft:light_gray_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:white_tulip"
}
],
"results": [
{
"item": "minecraft:light_gray_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:allium"
}
],
"results": [
{
"item": "minecraft:magenta_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:lilac"
}
],
"results": [
{
"item": "minecraft:magenta_dye",
"count": 4
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:orange_tulip"
}
],
"results": [
{
"item": "minecraft:orange_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:peony"
}
],
"results": [
{
"item": "minecraft:pink_dye",
"count": 4
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:pink_tulip"
}
],
"results": [
{
"item": "minecraft:pink_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:poppy"
}
],
"results": [
{
"item": "minecraft:red_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:rose_bush"
}
],
"results": [
{
"item": "minecraft:red_dye",
"count": 4
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:red_tulip"
}
],
"results": [
{
"item": "minecraft:red_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:dandelion"
}
],
"results": [
{
"item": "minecraft:yellow_dye",
"count": 2
}
]
}

View file

@ -1,16 +0,0 @@
{
"type": "techreborn:extractor",
"power": 10,
"time": 300,
"ingredients": [
{
"item": "minecraft:sunflower"
}
],
"results": [
{
"item": "minecraft:yellow_dye",
"count": 4
}
]
}