Grunt work detected

- Added a foundation for generating recipes of vanilla types
- Transferred a couple recipes from main to generated as POC
This commit is contained in:
simibubi 2020-08-27 02:35:57 +02:00
parent 0d1085ef09
commit 0349217082
44 changed files with 741 additions and 308 deletions

View file

@ -1444,6 +1444,14 @@ a135eec618e448f440d9f42cc7a3e6c63fc45a71 data/create/advancements/overstressed.j
1e3cd82e36fd4bcd053d652a0eead4458ed7f315 data/create/advancements/press.json
b2782692d27ffb105e3167174cebe1ebdd4a9867 data/create/advancements/recipes/create.base/brass_block.json
df6f220e693f5256bb3df8d6c7769bc931820ae5 data/create/advancements/recipes/create.base/copper_block.json
dbe67196168805a5903aa29de7631d33329060d1 data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematic_table.json
0c5badff77b751b086b0da5943bea186256668cb data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematicannon.json
c2ff86e360002e714877060540378940b8d72c4b data/create/advancements/recipes/create.base/crafting_shapeless/appliances/dough.json
b77cfa58f80d92299ea628b361bd42d462517d13 data/create/advancements/recipes/create.base/crafting_shapeless/materials/red_sand_paper.json
cbbd15261cbb270237347cf00246a6b4045e5ce0 data/create/advancements/recipes/create.base/crafting_shapeless/materials/rose_quartz.json
aaea2ee62bb7888e83fcc282c87bc6cb970d30ec data/create/advancements/recipes/create.base/crafting_shapeless/materials/sand_paper.json
f6b8aa96169d3857c31d8a087ca1dd6b5077defc data/create/advancements/recipes/create.base/crafting_shapeless/schematics/empty_schematic.json
e53989fa8a2742b55226e4af040ae3a98cc07994 data/create/advancements/recipes/create.base/crafting_shapeless/schematics/schematic_and_quill.json
82280c50b78dd7e8c179cb8e8f0c074b26ec9586 data/create/advancements/recipes/create.base/zinc_block.json
909345eb2f5541a2be592a52800319a8765ca345 data/create/advancements/recipes/create.palettes/acacia_window.json
73f99cd857b056da5e19ff8304a4f5eeacc4f8cd data/create/advancements/recipes/create.palettes/acacia_window_pane.json
@ -1818,6 +1826,8 @@ b77c5aecd0b6dd37a0c69431ab7a4a40fe0770eb data/create/advancements/recipes/create
e548127075559307b767b802f4809ed52eedd543 data/create/advancements/recipes/create.palettes/weathered_limestone_cobblestone_wall_from_weathered_limestone_cobblestone_stonecutting.json
23ba836640a4d543db6f1cb72cc86a6543fe2fbe data/create/advancements/recipes/create.palettes/weathered_limestone_pillar.json
9790a16fd56e47cb5abbfad4062672303c224d9f data/create/advancements/recipes/create.palettes/weathered_limestone_pillar_from_weathered_limestone_stonecutting.json
731da8361ecf00e2280a269e15cee00195d70bd7 data/create/advancements/recipes/food/crafting_shaped/appliances/cake.json
fc2411c0f4a4da43f6f213fc3bfffd35e6ad3775 data/create/advancements/recipes/misc/crafting_shapeless/appliances/slime_ball.json
e0b9edc5e59647e7dd99be17369b263dadf407d4 data/create/advancements/refined_radiance.json
fc12b590ab8f5ac901db21c67ba3850f157e1421 data/create/advancements/root.json
8529fc7919b6a3240ede2bb8043906bb72fb7f9e data/create/advancements/shadow_end.json
@ -1923,7 +1933,7 @@ d5fc5b3dc612cd748117e9d8b0ecda76e73f4514 data/create/loot_tables/blocks/dolomite
6121c99e6e037dda9022af3a414aee444467ac1b data/create/loot_tables/blocks/dolomite_pillar.json
503a93787537b46f462d32b0382c3396f42bb1f6 data/create/loot_tables/blocks/encased_belt.json
9055d82b983b673e1638d17b712b9fcd1f5a52e6 data/create/loot_tables/blocks/encased_fan.json
205f5899101262f31f5c1a88bb7d954918d08d04 data/create/loot_tables/blocks/encased_fluid_pipe.json
c8aa9bbed8fd703eb1853de0b7c9e04dffb7a511 data/create/loot_tables/blocks/encased_fluid_pipe.json
b127cb6920e6d7d9c8b2402cb186402a9a8dd3fc data/create/loot_tables/blocks/encased_shaft.json
5a47c1535c866184b4ffca65763f5676f319e0aa data/create/loot_tables/blocks/extractor.json
ddfc4764a6039d771e03af815ac4493da80d2e6b data/create/loot_tables/blocks/fancy_andesite_bricks.json
@ -1980,7 +1990,7 @@ ae19749df10663efc51b8b27af310164f250ed38 data/create/loot_tables/blocks/gabbro_c
e8d09c919e3b8125d7da0f38383c01bcfc61c7a8 data/create/loot_tables/blocks/gabbro_pillar.json
b0109b4a4f0f738cbbe6b5911e8c3c0310b76f99 data/create/loot_tables/blocks/gearbox.json
5f39461c5c9d3ad8d84195b06b9468fe2b0fb269 data/create/loot_tables/blocks/gearshift.json
205f5899101262f31f5c1a88bb7d954918d08d04 data/create/loot_tables/blocks/glass_fluid_pipe.json
c8aa9bbed8fd703eb1853de0b7c9e04dffb7a511 data/create/loot_tables/blocks/glass_fluid_pipe.json
74371bc2b516ad9742ca081d82dc1b7f642e25b4 data/create/loot_tables/blocks/granite_bricks.json
29f2cbc04f898bb8ff48055a7e43ded85e635bf9 data/create/loot_tables/blocks/granite_bricks_slab.json
6b2c74992f261df4f539ff65919e2f4a58b146ec data/create/loot_tables/blocks/granite_bricks_stairs.json
@ -2219,6 +2229,16 @@ c323b106e88b7de77fea71ff12494abdbb818d15 data/create/recipes/chiseled_limestone_
da9a919b476954c1de34826aa7706bf6056a8f12 data/create/recipes/chiseled_scoria_from_scoria_stonecutting.json
09faa4ddcf9f3907dcdb3ab3e8b68c1deb2486e5 data/create/recipes/chiseled_weathered_limestone_from_weathered_limestone_stonecutting.json
386c52f0aad6e2239f31dc85f7e745b47230846b data/create/recipes/copper_block.json
d19b3fa4bedacedf0c57aecba5a7e025e5a6b032 data/create/recipes/crafting_shaped/appliances/cake.json
5a7ee5951c15db03a4e38f5cbc1833f3d889e2b1 data/create/recipes/crafting_shaped/schematics/schematic_table.json
50cffa44fb016b856629538cb0be52c162139ec5 data/create/recipes/crafting_shaped/schematics/schematicannon.json
19526da3a59fc136654ff1bc93c0251581f397a9 data/create/recipes/crafting_shapeless/appliances/dough.json
7b5f863dda3d05a79cb85943a178eba0bd8a7dc7 data/create/recipes/crafting_shapeless/appliances/slime_ball.json
9c9e40ffd41ce46c65113080a92ff9b4f27e5fab data/create/recipes/crafting_shapeless/materials/red_sand_paper.json
7eb292bc564de70227f4bf947050bcdbfc5a8d67 data/create/recipes/crafting_shapeless/materials/rose_quartz.json
5ca47ec1bca9a5ce28aabd9868b74b71c829ca07 data/create/recipes/crafting_shapeless/materials/sand_paper.json
0b7acc249bed992387aa9702a2c05836ecf584df data/create/recipes/crafting_shapeless/schematics/empty_schematic.json
5c47ac2e2b596439a684126fef7265f13de2379b data/create/recipes/crafting_shapeless/schematics/schematic_and_quill.json
f2c317e03ac4d42fb631e1625607061e10c480fe data/create/recipes/dark_oak_window.json
d9dbae6e237eb38e53a619a0f1b339fca7c59b4d data/create/recipes/dark_oak_window_pane.json
55596a590962e3ddd40949917661f0bd94408274 data/create/recipes/dark_scoria_bricks_from_dark_scoria_stonecutting.json

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shaped/schematics/schematic_table"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "create:empty_schematic"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shaped/schematics/schematic_table"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shaped/schematics/schematicannon"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "create:empty_schematic"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shaped/schematics/schematicannon"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/appliances/dough"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "create:wheat_flour"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/appliances/dough"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/materials/red_sand_paper"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:paper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/materials/red_sand_paper"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/materials/rose_quartz"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:redstone"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/materials/rose_quartz"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/materials/sand_paper"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:paper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/materials/sand_paper"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/schematics/empty_schematic"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:paper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/schematics/empty_schematic"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/schematics/schematic_and_quill"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:paper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/schematics/schematic_and_quill"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shaped/appliances/cake"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "create:dough"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shaped/appliances/cake"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting_shapeless/appliances/slime_ball"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "create:dough"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting_shapeless/appliances/slime_ball"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -6,7 +6,7 @@
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
"name": "create:fluid_pipe"
}
],
"conditions": [

View file

@ -6,7 +6,7 @@
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
"name": "create:fluid_pipe"
}
],
"conditions": [

View file

@ -0,0 +1,25 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" . ",
"#+#",
" - "
],
"key": {
"#": {
"item": "minecraft:sugar"
},
"+": {
"tag": "forge:eggs"
},
".": {
"item": "minecraft:milk_bucket"
},
"-": {
"item": "create:dough"
}
},
"result": {
"item": "minecraft:cake"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
" + ",
" + "
],
"key": {
"#": {
"tag": "minecraft:wooden_slabs"
},
"+": {
"item": "minecraft:smooth_stone"
}
},
"result": {
"item": "create:schematic_table"
}
}

View file

@ -0,0 +1,28 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" . ",
"#+#",
"_-_"
],
"key": {
"#": {
"tag": "minecraft:logs"
},
"+": {
"item": "minecraft:dispenser"
},
".": {
"item": "minecraft:cauldron"
},
"_": {
"item": "minecraft:smooth_stone"
},
"-": {
"item": "minecraft:iron_block"
}
},
"result": {
"item": "create:schematicannon"
}
}

View file

@ -9,7 +9,6 @@
}
],
"result": {
"item": "create:dough",
"count": 1
"item": "create:dough"
}
}

View file

@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:dough"
},
{
"tag": "forge:dyes/lime"
}
],
"result": {
"item": "minecraft:slime_ball"
}
}

View file

@ -2,14 +2,13 @@
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:sand/red"
"item": "minecraft:paper"
},
{
"item": "minecraft:paper"
"tag": "forge:sand/red"
}
],
"result": {
"item": "create:red_sand_paper",
"count": 1
"item": "create:red_sand_paper"
}
}

View file

@ -0,0 +1,35 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:gems/quartz"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
}
],
"result": {
"item": "create:rose_quartz"
}
}

View file

@ -2,14 +2,13 @@
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:sand/colorless"
"item": "minecraft:paper"
},
{
"item": "minecraft:paper"
"tag": "forge:sand/colorless"
}
],
"result": {
"item": "create:sand_paper",
"count": 1
"item": "create:sand_paper"
}
}

View file

@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:paper"
},
{
"tag": "forge:dyes/light_blue"
}
],
"result": {
"item": "create:empty_schematic"
}
}

View file

@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:empty_schematic"
},
{
"tag": "forge:feathers"
}
],
"result": {
"item": "create:schematic_and_quill"
}
}

View file

@ -83,7 +83,9 @@ public enum AllSoundEvents implements IDataProvider {
}
public void generate(Path path, DirectoryCache cache) {
Gson GSON = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create();
Gson GSON = (new GsonBuilder()).setPrettyPrinting()
.disableHtmlEscaping()
.create();
path = path.resolve("assets/create");
try {
@ -94,7 +96,8 @@ public enum AllSoundEvents implements IDataProvider {
if (soundEvent.child != null) {
// wrapper
JsonObject s = new JsonObject();
s.addProperty("name", soundEvent.child.getName().toString());
s.addProperty("name", soundEvent.child.getName()
.toString());
s.addProperty("type", "event");
arr.add(s);
} else {
@ -120,6 +123,6 @@ public enum AllSoundEvents implements IDataProvider {
@Override
public String getName() {
return null;
return "Create's Custom Sound: " + name();
}
}

View file

@ -15,6 +15,7 @@ import com.simibubi.create.foundation.command.ServerLagger;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.LangMerger;
import com.simibubi.create.foundation.data.StandardRecipes;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.worldgen.AllWorldFeatures;
import com.tterrag.registrate.util.NonNullLazyValue;
@ -102,6 +103,7 @@ public class Create {
DataGenerator gen = event.getGenerator();
gen.addProvider(new AllAdvancements(gen));
gen.addProvider(new LangMerger(gen));
gen.addProvider(new StandardRecipes(gen));
gen.addProvider(AllSoundEvents.BLAZE_MUNCH.generator(gen));
}

View file

@ -308,7 +308,7 @@ public class AllAdvancements implements IDataProvider {
@Override
public String getName() {
return "CreateAdvancements";
return "Create's Advancements";
}
public PlacedBlockTrigger.Instance placeBlock(Block block) {

View file

@ -0,0 +1,230 @@
package com.simibubi.create.foundation.data;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
import com.google.common.base.Supplier;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.content.AllSections;
import com.simibubi.create.foundation.utility.Lang;
import com.tterrag.registrate.util.entry.ItemProviderEntry;
import net.minecraft.block.Blocks;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.data.RecipeProvider;
import net.minecraft.data.ShapedRecipeBuilder;
import net.minecraft.data.ShapelessRecipeBuilder;
import net.minecraft.item.Items;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.Tags;
@SuppressWarnings("unused")
public class StandardRecipes extends RecipeProvider {
final List<GeneratedRecipe> all = new ArrayList<>();
/*
* Recipes are added through fields, so one can navigate to the right one easily
*
* (Ctrl-o) in Eclipse
*/
private Marker MATERIALS = enterSection(AllSections.MATERIALS);
GeneratedRecipe ROSE_QUARTZ = create(AllItems.ROSE_QUARTZ).unlockedBy(() -> Items.REDSTONE)
.viaShapeless(b -> b.addIngredient(Tags.Items.GEMS_QUARTZ)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)
.addIngredient(Tags.Items.DUSTS_REDSTONE)),
SAND_PAPER = create(AllItems.SAND_PAPER).unlockedBy(() -> Items.PAPER)
.viaShapeless(b -> b.addIngredient(Items.PAPER)
.addIngredient(Tags.Items.SAND_COLORLESS)),
RED_SAND_PAPER = create(AllItems.RED_SAND_PAPER).unlockedBy(() -> Items.PAPER)
.viaShapeless(b -> b.addIngredient(Items.PAPER)
.addIngredient(Tags.Items.SAND_RED))
// TODO
;
private Marker CURIOSITIES = enterSection(AllSections.CURIOSITIES);
// TODO
private Marker KINETICS = enterSection(AllSections.KINETICS);
// TODO
private Marker LOGISTICS = enterSection(AllSections.LOGISTICS);
// TODO
private Marker SCHEMATICS = enterSection(AllSections.SCHEMATICS);
GeneratedRecipe SCHEMATIC_TABLE = create(AllBlocks.SCHEMATIC_TABLE).unlockedBy(AllItems.EMPTY_SCHEMATIC::get)
.viaShaped(b -> b.key('#', ItemTags.WOODEN_SLABS)
.key('+', Blocks.SMOOTH_STONE)
.patternLine("###")
.patternLine(" + ")
.patternLine(" + ")),
SCHEMATICANNON = create(AllBlocks.SCHEMATICANNON).unlockedBy(AllItems.EMPTY_SCHEMATIC::get)
.viaShaped(b -> b.key('#', ItemTags.LOGS)
.key('+', Blocks.DISPENSER)
.key('.', Blocks.CAULDRON)
.key('_', Blocks.SMOOTH_STONE)
.key('-', Blocks.IRON_BLOCK)
.patternLine(" . ")
.patternLine("#+#")
.patternLine("_-_")),
EMPTY_SCHEMATIC = create(AllItems.EMPTY_SCHEMATIC).unlockedBy(() -> Items.PAPER)
.viaShapeless(b -> b.addIngredient(Items.PAPER)
.addIngredient(Tags.Items.DYES_LIGHT_BLUE)),
SCHEMATIC_AND_QUILL = create(AllItems.SCHEMATIC_AND_QUILL).unlockedBy(() -> Items.PAPER)
.viaShapeless(b -> b.addIngredient(AllItems.EMPTY_SCHEMATIC.get())
.addIngredient(Tags.Items.FEATHERS))
;
private Marker APPLIANCES = enterFolder("appliances");
GeneratedRecipe
DOUGH = create(AllItems.DOUGH).unlockedBy(AllItems.WHEAT_FLOUR::get)
.viaShapeless(b -> b.addIngredient(AllItems.WHEAT_FLOUR.get())
.addIngredient(Items.WATER_BUCKET)),
SLIME_BALL = create(() -> Items.SLIME_BALL).unlockedBy(AllItems.DOUGH::get)
.viaShapeless(b -> b.addIngredient(AllItems.DOUGH.get())
.addIngredient(Tags.Items.DYES_LIME)),
CAKE = create(() -> Items.CAKE).unlockedBy(AllItems.DOUGH::get)
.viaShaped(b -> b.key('#', Items.SUGAR)
.key('+', Tags.Items.EGGS)
.key('.', Items.MILK_BUCKET)
.key('-', AllItems.DOUGH.get())
.patternLine(" . ")
.patternLine("#+#")
.patternLine(" - "))
;
/*
* End of recipe list
*/
String currentFolder = "";
Marker enterSection(AllSections section) {
currentFolder = Lang.asId(section.name());
return new Marker();
}
Marker enterFolder(String folder) {
currentFolder = folder;
return new Marker();
}
GeneratedRecipeBuilder create(ItemProviderEntry<? extends IItemProvider> result) {
return create(result::get);
}
GeneratedRecipeBuilder create(Supplier<IItemProvider> result) {
return new GeneratedRecipeBuilder(currentFolder, result);
}
@FunctionalInterface
interface GeneratedRecipe {
void register(Consumer<IFinishedRecipe> consumer);
}
class Marker {
}
class GeneratedRecipeBuilder {
private String path;
private String suffix;
private Supplier<IItemProvider> result;
private Supplier<IItemProvider> unlockedBy;
private int amount;
public GeneratedRecipeBuilder(String path, Supplier<IItemProvider> result) {
this.path = path;
this.suffix = "";
this.result = result;
this.amount = 1;
}
GeneratedRecipeBuilder returns(int amount) {
this.amount = amount;
return this;
}
GeneratedRecipeBuilder unlockedBy(Supplier<IItemProvider> item) {
this.unlockedBy = item;
return this;
}
GeneratedRecipeBuilder withSuffix(String suffix) {
this.suffix = suffix;
return this;
}
GeneratedRecipe viaShaped(UnaryOperator<ShapedRecipeBuilder> builder) {
return register(consumer -> {
ShapedRecipeBuilder b = builder.apply(ShapedRecipeBuilder.shapedRecipe(result.get(), amount));
if (unlockedBy != null)
b.addCriterion("has_item", hasItem(unlockedBy.get()));
b.build(consumer, createLocation("crafting_shaped"));
});
}
GeneratedRecipe viaShapeless(UnaryOperator<ShapelessRecipeBuilder> builder) {
return register(consumer -> {
ShapelessRecipeBuilder b = builder.apply(ShapelessRecipeBuilder.shapelessRecipe(result.get(), amount));
if (unlockedBy != null)
b.addCriterion("has_item", hasItem(unlockedBy.get()));
b.build(consumer, createLocation("crafting_shapeless"));
});
}
private GeneratedRecipe register(GeneratedRecipe recipe) {
all.add(recipe);
return recipe;
}
private ResourceLocation createLocation(String recipeType) {
return Create.asResource(recipeType + "/" + path + "/" + result.get()
.asItem()
.getRegistryName()
.getPath() + suffix);
}
}
@Override
public String getName() {
return "Create's Standard Recipes";
}
public StandardRecipes(DataGenerator p_i48262_1_) {
super(p_i48262_1_);
}
@Override
protected void registerRecipes(Consumer<IFinishedRecipe> p_200404_1_) {
all.forEach(c -> c.register(p_200404_1_));
}
}

View file

@ -1,26 +0,0 @@
{
"type": "crafting_shaped",
"pattern": [
" M ",
"SES",
" D "
],
"key": {
"M": {
"item": "minecraft:milk_bucket"
},
"S": {
"item": "minecraft:sugar"
},
"E": {
"item": "minecraft:egg"
},
"D": {
"item": "create:dough"
}
},
"result": {
"item": "minecraft:cake",
"count": 1
}
}

View file

@ -1,16 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/brass"
}
},
"result": {
"item": "create:brass_ingot"
}
}

View file

@ -1,16 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/copper"
}
},
"result": {
"item": "create:copper_ingot"
}
}

View file

@ -1,16 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/zinc"
}
},
"result": {
"item": "create:zinc_ingot"
}
}

View file

@ -1,20 +0,0 @@
{
"type": "crafting_shaped",
"pattern": [
"WWW",
" S ",
" S "
],
"key": {
"W": {
"tag": "minecraft:wooden_slabs"
},
"S": {
"item": "minecraft:smooth_stone"
}
},
"result": {
"item": "create:schematic_table",
"count": 1
}
}

View file

@ -1,29 +0,0 @@
{
"type": "crafting_shaped",
"pattern": [
" C ",
"LDL",
"SIS"
],
"key": {
"I": {
"item": "minecraft:iron_block"
},
"D": {
"item": "minecraft:dispenser"
},
"L": {
"tag": "minecraft:logs"
},
"S": {
"item": "minecraft:smooth_stone_slab"
},
"C": {
"item": "minecraft:cauldron"
}
},
"result": {
"item": "create:schematicannon",
"count": 1
}
}

View file

@ -1,15 +0,0 @@
{
"type": "crafting_shapeless",
"ingredients": [
{
"item": "create:empty_schematic"
},
{
"item": "minecraft:feather"
}
],
"result": {
"item": "create:schematic_and_quill",
"count": 1
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:brass_block"
}
],
"result": {
"item": "create:brass_ingot",
"count": 9
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/brass"
}
],
"result": {
"item": "create:brass_nugget",
"count": 9
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:copper_block"
}
],
"result": {
"item": "create:copper_ingot",
"count": 9
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/copper"
}
],
"result": {
"item": "create:copper_nugget",
"count": 9
}
}

View file

@ -1,15 +0,0 @@
{
"type": "crafting_shapeless",
"ingredients": [
{
"item": "minecraft:paper"
},
{
"item": "minecraft:light_blue_dye"
}
],
"result": {
"item": "create:empty_schematic",
"count": 1
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:linked_extractor"
}
],
"result": {
"item": "create:extractor",
"count": 1
}
}

View file

@ -1,36 +0,0 @@
{
"type": "crafting_shapeless",
"ingredients": [
{
"tag": "forge:gems/quartz"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
},
{
"tag": "forge:dusts/redstone"
}
],
"result": {
"item": "create:rose_quartz",
"count": 1
}
}

View file

@ -1,15 +0,0 @@
{
"type": "crafting_shapeless",
"ingredients": [
{
"tag": "forge:dyes/lime"
},
{
"item": "create:dough"
}
],
"result": {
"item": "minecraft:slime_ball",
"count": 1
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:zinc_block"
}
],
"result": {
"item": "create:zinc_ingot",
"count": 9
}
}

View file

@ -1,12 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/zinc"
}
],
"result": {
"item": "create:zinc_nugget",
"count": 9
}
}