Skip to content

Commit

Permalink
Implemented dynamic recipe gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragonoidzero committed Mar 16, 2021
1 parent 2c11aab commit 5f7fb2e
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/main/java/azzy/fabric/incubus_core/IncubusCoreCommon.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package azzy.fabric.incubus_core;

import azzy.fabric.incubus_core.datagen.Metadata;
import azzy.fabric.incubus_core.datagen.RecipeJsonGen;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.item.Items;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand All @@ -12,5 +16,7 @@ public class IncubusCoreCommon implements ModInitializer {

@Override
public void onInitialize() {
if(!FabricLoader.getInstance().isDevelopmentEnvironment())
LOG.info(IncubusCoreInit.HOLY_CONST);
}
}
85 changes: 85 additions & 0 deletions src/main/java/azzy/fabric/incubus_core/IncubusCoreInit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package azzy.fabric.incubus_core;

public class IncubusCoreInit {

public static final String HOLY_CONST = "hhddmmmmNNNNNNmmmdddhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdMMmyo-::-:::::::////++++++++/////::----------------------------------------::::::::://///////++syddd\n" +
"MMMMMNNNmmmmmmNNNNMMMMNNddhhhhhhhhhhhhhhhhhhhhhhhdMMNhy+oyhdmmNNNNNNmmmmmmmmmmmmmNNNNNNNmmdhyyso+/:-------------------------::::::::::////////////+osh\n" +
"mdhhhyyyyyyyyyyyyyyhhdmNNddhhhyhyhhhhhhyhhhyhhhmNMMMMNmmddhhhyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhddmmmmNmmdhso+:-----------------:::::::::///////////////+o\n" +
"yyyyyyyyyyyyyyyyyyyyyymmNdhyyyyyyyyyyyyyyyhdmNMMMNmdhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhddmmmmmhyo+:---------:::::::::://////////////+sh\n" +
"yyyhhhhhhhhhhhhhhhhhhdmNmdhyyyyyyyyyyyyhdNMMMNNdhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhhhhdddmmmNmdys+/:-::::::::://///////////+oydNN\n" +
"dddddmmmNNNNNNNNNNNNNNMNdhhhhhhhhhhhhdmMMMNmdhhhhyhhhhhhyyhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhddddddddddddddmmmmNNNmdyo+/:::::///////////+shmNNdh\n" +
"mmNNMMMMMNNmmmmmmmNNNMMMMNmddhhhhhhdNMMNmdhhhyyyhhhhhyyyhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhddddddddddddddmmmmmmmmmmNNNmdyo+//////////+shmNmdhhh\n" +
"MMNNmdhhyyyyyyyyyyyyyyhhdmNMNNdhhdNMMNmdyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhhhhddddddddddddmmmmmmmmmNNNNdyo+////+shNNmdhyyyy\n" +
"mdhyyyyyyyyyyyyyyyyyyyyyyyyhmNNNMMMNmhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhhdddddddddddddmmmmmmmmmmmmNNNmhsoydNNmdhyyyyyy\n" +
"hyyyyyyyyyyyyyyyyyyyyyyyyyyyhmNMMNmdhyyyyyyyyyhhhhhhhhhddddddddddddddhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdddddddddddddmmmmmmmmmmmmmmmmmmmmmNNNMNNmdhyyyyyyyy\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhmNMNmdhhhhddddmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmNNNNmmmmmmmmddddddddddddddddddddddmmmmmmmmmmmmmmmmmmmmmmmmmNMMMNdhhhhhhhhhhh\n" +
"yyyyyyyyyyyyyyyyyyyyyyyyyydmNMNmdddmmmmmmmmmmmmmmmmmmmmmmmmmmmdddddddddddddddddddddddddmmmmmmmmmmmmddddddddddddmmmmmmmmmmmmmmmmmmmmmNMMNmdhyyyyyyyyyyy\n" +
"yyyyyyyyyyyyyyyyyyyyyyyyydmNNNmmmmNmmNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMMMMMMNNNNNNmmmddhhhhhhhhddmmmmmmmmmmdddddmmmmmmmmmmmmmmmmmNNMMmdyyyyyyyyyyyyy\n" +
"yyyyyyyyyyyyyyyyyyyyyyyhmNMMNNNMMMMNNNNNNmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmNNNNNNNNNNNNNMMMMMMMMMNNNmmddhhhhhddmmmmmmmmmmmmmmmmmmmmmmmmNNMNdhyyyyyyyyyyyyy\n" +
"yyyyyyyyyyyyyyyyyyhhdmNNMMMMMNNmdddhdddddddddddddddddddddmmmmmmmmmmmmmNNNNNNNNNNNNNNNNNNNNNNNNMMMMMMMMMNNmmmdddddmmmmmmmmmmmmmmmmmNMMMmdhyhyyyyyyyyyyy\n" +
"yyyyyyyyyyyyyyhhdmmNMMMNNmddhhyyyyyyyyyyyyyyyyhhhhhhhhhhhhhhhhhhhhhhdddddddddmmmmmmmmNNNNNNNMMMMMMMMMMMMMMMMMMMNNmmmmmmmmmmmmmmmmmNMMNddyyhyyyyyyyyyyy\n" +
"yyyyyyyyyyyyyhdNMMMNmdhyyyssssssssssssssssssyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhdmNMMMMNNNNNNNNNNNMMMMMMMMMMMMMNNmmmmmmmmmmmNMMmdyyyyyyyyyyyyyyy\n" +
"yyyyyyyyyyydmNMMNmhysssssssssssssssssssssssssyyhhho+ssssssssssyyyyssssssyyyyssyyyyyyhmNMMNmdhyyyhhhddmmNNNNNMMMMMNNNMMMMMMNNmmmmmNNMMddyyyyyyyyyyyyyyy\n" +
"yyyyyyyyyydNNNmdysssssssssoosssssssssssssssyyhdmdd+/+osssysssyhhhhhyyyyyyyyyyyyyyydmNMNmdhyyyyyyyyyyyhhhdmmmNNNNMMMNNNNMMMMMMMMNNMMMNddyyyyyyyyyyyyyyy\n" +
"hhhhhhhhhhNNMmmyssssssso+/::+ossssssssssssyhdddmddo/:oosyyyyyyhhdddddhyyyyyyyyyyydmMNmhyyyyyyyyyyyyyyyyyyyhhddmmmNNNNNNMMMMMMMMMMMMMNdhhhhhhhhhhhhhhhh\n" +
"yyyyyyyyyhmNMmdssssso+/::::/oosssssssssssyyddssyhddo++ssyssssyyhddddmmddhyysssssyhhdhyssssssssssssssssssssssssyyyhddmmmNNNMMMMMNNNMMmdhyyyyyyyyyyyyyyy\n" +
"yyyyyyyyyhmNMmdsoo+/::::::/oooooooooooosyyhdso/shmNNNNmmmddyysyyhhhddddmmmdhyysssssssssssssssssssssssssssssssssssssyyhdmmNNMMMMNNNNMmdyyyyyyyyyyyyyyyy\n" +
"yyyyyyyyyhmNMmdsoo/::::::/+oooooooooossyhhdhshymNMMMNNmmNNNmdhyyhhhddmddhhmNNNmdhyyssssssssssssssssssssssssssssssyyhdmNNMMMMNNmmNNNMddyyyyyyyyyyyyyyyy\n" +
"hhhhhhhhhhmNMmdyss+/::::/+ossssssssssyyhdmmhNmNdyshdmmhyyyhddhhyyhdddmNmdhyyyhmmNNNNNmmddhhhyyyyyyyyyyyyyyhhddmNNNNNmdhhmmNNNNNNNNNNddhhhhhhhhhhhhhhhh\n" +
"hhhhhhhhhhdNNNdhsso/:-:/+oossoooosssyyhddmNMMmy+:-:oydmmdyssssssyyhdddmmNNdysooossyhddmmNNNNNNNNNNNNNNNMMMMNNNmddhysssoshdNNmmmNNNNNddhhhhhhhhhhhhhhhh\n" +
"yyyyyyyyyhhmNMmdsoo/:::++oooooooossyyyhhdmMMds+:----:+sdmNmdhysoossyhhhddmNNdyo+++++++++ooossyyhhdmmNNNNMMNNMMMNNNNmmdhhdmNNmmmmmmNNddyyyyyyyyyyyyyyyy\n" +
"yyyyyyyyyhhhmNNmhoo/::/+oooooooossyyyhhhdNNhs/:::::::--:+shmNNNmdhyyyyyyyhhdNNmho++++///++syhmNNMNNNNNMMMMMMMMMMMMMMNNmNNNNNddmmmmmNddyyyyyyyyyyyyyyyy\n" +
"hhhhhhhhhhhhmNNNmhso/:++ooooooosyyhhhdhmmNhs/::::::::::----:/oyhdmNNNNNmmmmNmmdyo++++oshmNNMNmdys/:.-oymNNNNNNNMMMMNhyoydmNmdmmmmNNNmdhhhhhhhhhhhhhhhh\n" +
"hhhhhhhhhhdddmNMNmdsooooooooooyyhhddddymmmyo////////:::::------::://++ooossoo++///+shmNNmdy+:.`` ``.+ydddddmmmmmNMdhoohdNNmdmmmmNNNmdhhhhhhhhhhhhhhhh\n" +
"hhhhhhhhhhhhhhdNNMNdyoooooooosyhhhdddyhdNdy+////////:::::::::::::::///////////////syhho/-.``` `-/shhddddddddddmmNmhsshdNNhhddmmmNNmmhhhhhhhhhhhhhhhh\n" +
"yyyyhhhhhhhhhhhdmNMMmdyooooosyhhhhhhhodhNhy/////////:::::::::::::://///////////////:-.```` .-+syhhhhhhddmNMNmhsshmNmhhhhdddmmmmdhhhhhhhhhhhhhhh\n" +
"hhhhhhhhhhhhhhhdddmNMMNmhysyyhdhddddysddNhs++//////////+oossyyys+//:////:::::::::////:.``` `-/oyhmmNMMNhso//yhmNmhhhhdddmNNmdhhhhhhhhhhhhhhh\n" +
"hhhhhhdddddddddddddmNNMMMNmmddddddddsddNmhs++++++oyhdNNMMMMMMMmhs/::::::::----..........--://///::-----:+shmmmho:..:/+ydNNdhhhddmmmNNmmddddddddddddddd\n" +
"dhhhhhdddddddddddddddmmNMMMMNNmmddddymdMdho+osydNNMMNmmNNNNNMMmyo::-----..............`````...--::/+++++++//-..````.:+hdNNdhhhddmmmNNmmddddddddddddddd\n" +
"hhhhhhhhhhhhhhddddddddddmmNNMMMMNNmdhmmNhhshmNMNmyyo:.`+smmmmmhs:..:oydhs+:.....````````````````````````````````````:ohdNmhyyhhhdddmNNmdhhhhhhhhhhhhhh\n" +
"dhhhhhhhhhhhhdddddddddddmmmmmNNNMMMMMMMMNMNMmho:.`---//shddddho/`.:yhdy+/++:...`````````````````````````````````````:shmNmyyyhhddddmmNmmdddddddddddddd\n" +
"ddddhhddddddddddddddmmmmmmmmmmmmmNMMNMNMMmy+:.`````:/yhhhhddy+:```+yys/----:..``````````````````````````````````````:yhNNdhhhdddmmmmNNmmdddddddddddddd\n" +
"mmddddddddddddddddmmmmmmmmmmmmmmmNMMMNNmo:-.`` `-/shdddo/.````.+yys+:/o/:.``````````````````````````````````````/ydNNdhhhddmmmmmNNNmmdmdmddddddddd\n" +
"ddddddhhdddddddddddddmmmmmmmmmmmmMMNMNd+:`.`` .:+ss+-.````````.-/++/-.````````````````````..``````````````````+ydNmhhhhhdddddmmNNmmddddddddddddd\n" +
"mdddddhhhhhdddddddddddmmmmmmmmmmNMMNMmy+.`.-::::://++/-.```````````````````````````````````````/y+/.````````````````symNmyyyhhhdddddmmNmmddddddddddddd\n" +
"NNmmdddddddddddddddddmmmmmmmmmmmNMMNNms+.``````....```````````````````````````````````````````/s//.````````````````.yhNNdyyhhhddddddmmNNmmmmmmmmmmmmdd\n" +
"mMNNmmmddddddmmmmmmmmmmmmmmmmmmNMMNNNNy+.``````````````````````````````````````````````````-+yy+:``````````````````+ymNmhhhhdddmmmmmmNNNmmmmmmmmmmmmmm\n" +
"dmMMNmmmmdddddmmmmmmmmmmmmmmmmmNMMNNmNy+-``````````````````````````````````-://::----::/oshhy+-.``````````````````+ymNmhyhhdddddmmmmmNNNNmmmmmmmmmmmmm\n" +
"ddmMMNNmmmmdddddddmmmmmmmmmmmmmNMMNNmmh+-```````````````````````````````./yys+///+++++//:-..````````````````````.ohmmdyyyhhhhhhddddddmmNNmmmmmmmmmmmmm\n" +
"dddmMMMNmmmmmddddmmmmmmmmmmmmmNNMNNddmd+:````````````````..`````````.-/sys/-```````````````````````````````````-shmmdyyyhhhhhhhddddddmmNNmmmmmmmmmmmmm\n" +
"dddddNMMNNmmmmmmmmmmmmmmmmmmmmNMMNNdmmN+/`````````````````.....--://+/:-.`````````````````````````````````````/ydNmdyyhhddddddddmmmmmmNNNNmmmmmmmmmmNN\n" +
"ddddddNMMMNNmmmmmmmmmmmmmmmmmNMMMNmdmmNo+```````````````````````````````````````````````````````````````````.ohmNmhyyhhdddddddmmmmmmmmNNNNmmmmmmmmmNNN\n" +
"hhhhhhhmMMMNNmmmmmmmmmmmmmmmmNMMNNdhdmNy+.`````````````````````````````````````````````````````````````````-shNmdyyyyhhhhhddddddddddddmNNNmmmmmmmmNNNN\n" +
"hhhhhhhhdNMMNNmmmNNNmmmmmmmmmNNMNmhhhdmm+:````````````````````````````````````````````````````````````````:ydNmhssyyyhhhhhhhhhddddddhddNNNmmmmmmmmNNNN\n" +
"hhhhhhhdhdNMMNNmmmNNNNNmmmmmmMMNNmhhddmNs/.``````````````````````````````````````````````````````````````+ymmmyssyyhhhhhhhhdddddddddyddNNNmmmmmmmNNNNN\n" +
"dddddddddddmMMMNmmmNNNNNNNNNNMMNNddddmmNmo/````````````````````````````````````````````````````````````.ohmmdyssyyhhddddddddddmmmmmdsmdNNNNmmmmNNNNNNN\n" +
"hhhhhhhhhhhhdNMMNmmdmNNNNNNNMMMNmhhddmmmNmo/``````````````````````````````````````````````````````````.ohmmhyssyyhhhhhhddddddddddmmhymmMNNNmmNNNNNNNNN\n" +
"hhhhhhhhhhhhhhmMMMmmddmNNNNNMMNNdhyhhddmmNmy/.```````````````````````````````````````````````````````.ohmmhssssyyyhhhhhhhhhhddddddhsddNNNmmmmmNNNNNNNN\n" +
"hhhhhhhhhhhhhhhdNMMNmdhdmNNMMMNmhyyhhddddmmNms:.```````````````````````````````````````````````````..oydmyssssyyyyyyyhhhhhhhdddddhshdNMNNmmmmmNNNNNNNN\n" +
"dhhhhhhhhhhhhhhhdmMMMNdhhdNMNNmhhhhddmmmmmmNNNds/.`````````````````````````````````````````````...--+yhmhssssyyhhyhhhhhddddddddddshdNMMNNNmNNNNNNNNNNN\n" +
"dddddddddddddddddddNMMNmmmNNmdhhhhddmmmmmmmmmNNNmy+:.`````````````````````````````````````...----::/yhddssssyyyhyhyhhhdddddddmmdshdNMMNNNNNNNNNNNNNNNN\n" +
"hhhhhhhhhhhhhhhhhhhhmMMMMMNmhyyyhhhddddddmmmmmmmmNNmyo:-.```````````````````````````....----:::::::oyhmyshyhyyyssyyhhhhhhdddddhshdNMMMNNNmNNNNNNNNNNNN\n" +
"hhhhhhhhhhhhhhhhhhhhhmMMNmdyyyyyyhhhhhdddddddddddhhdmNNdy+:-.```````````````......-----::::::://///yhddyhddhyssssyyyyhhhhhhhdyyhdNNMmNNNmmNNNNNNNNNNNN\n" +
"hhhhhhhhhhhhhhhhhhhdmMMNmhyyyyyhhhhhddddddddddddddshhmMNMNNmhs+:-.........----------::::::///////+ohhmmdmmdhssssyyhhhhhhdhhdyhddNmdddNNNNNNNNNNNNNNNNN\n" +
"dddddddddddddddddddNMNNmmddyyyhhhhhdddddmmmmmmmmmdsshdNhhsydmNNNmhyo+/:------------:::::///////+++shdNNNMmdhssssyyhhhdddhhmddNmNdyyymNNNNNNNNNNNNNNNNN\n" +
"dddddddddddddddddmMMNNNNmmhsyyyyyhhdddddddddmmmmmdssyhNyy///++syhdmNNNmdhso+/::---::::::///////+++yhmMNNNmdysoosyhhhhddhydmNMNNdyoyhNNNNNNNNNNNNNNNNNN\n" +
"hhhhhhhhhhhhhhhhmMMMMNMNmhssssssyyyhhhhhhhdddddddhsshdds+:::::::///+ooshdmNNNNhs/::::::////////+++yhNMNNmmdhooosyyhhhhyohhNMMNdyoshdNNNNNNNNNNNNNNNmmN\n" +
"hhhhhhhhhhhhhhhdMMMMNMMmdsssssssyyyhhhhhhhhhdddhdhshhmyo----::::::::::::/oydNMMNmy+/:::///+osyhdmmNMMNNNNNdhoooyyhhhhy+shmMMNdyooyhNNNNNNNNNNNNNNmdddd\n" +
"dddddddddddddddmMMMmNMNddsssssssyyhhhhhhddddddymdhddmhs/------::::://+oyhmmNNmmNNNmyo///shmNNNmdhyyddhy+yhddsosyyhhddsohhNMNhs+oohdNNNNNNNNNNNNmdhhdmN\n" +
"dddddddddddddddNMMmdMMNdhooooooosyhhhhhhdddddyhdmdNdds+---------:+oydNNNNmys+//+ydNNhs/+hdNhy/:---:osoo/syhhyosyhddddoyhmMmhs++oyhmNNNNNNNNNNNmhyydmMm\n" +
"hhhhhhhhhhhhhhhmMmddMMNdyooooooosyyyhhhhhhhhysddNNNmyo----------+ydNmho//o+//:::/shmNds+shmys:----:://+ossyososyyhhhyoddMmho/+ooyhNNNNNNNNNNmdysshmNNm\n" +
"hhhhhhhhhhhhhhhmmdddMMNdhoooooooosyyyyyyyyhy+shmMMMhs/----------/shNhs/---++//::::+ydNhs+yhds+---:::/oso/+sssysyyhhhohhNmhs/+ooshdNNNNNNNNNmdsoshdNNmd\n" +
"hhhhhhhhhhhhhhhhhhhhNMMmdsooooooosyyyyhhhhho+yhNMMNyo:-----------:oymmyo:--/+//::::/shmhs+ydys:-:::+o+////oyydyyyhhhydmNhs/++ooyhmNNNNNNNNmdhsshdNNmdh\n" +
"hhhhhhhhhhhhhhhhhhhhdMMMmdsoooooosyyhhhhhhyo+yhmMNms+--------------:ohmds+--:++/////+hddy++yhso:::/+//::///yyddhhdddmmNhy//+ooshdNNNNNNNNNddyshdNNmddh\n" +
"hhhhhhhhhhhhhhhhhhhhhdMMMmdyoooooosyyhhhhhoo/hdhmhss/:::-------------:oydhs/--/++/+oydNNmyoyhsy/:/:::::////+shmNddddmNdy+/+oooyhmNNNNNNNNmdyshdNNmddhh\n" +
"hhhhhhhhyhhhhhhhhhhhhhhNMMNmdsooooossyyyyy++/hhyy/:::::::::::::::------:oydhs/:/sydmNNNmNNNmNdys:::::////////symNNdmmmho//+ooshhNNNNNNNNNdhsydmNmdhhhh\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhdNMMMNdysoooosyyyyo+ohdhs:::::::::::::::::::::::::oydddddNNhyssssyydmMdy+::://////////+shNMMNdy//+oooyhmNNNNNNNNmdsshmMmdhhhhh\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhhhdmNMMNNdysoosyyho+shmMdy+::::::::::::::::::::::::/oydNNNhssssssssyhmNys://////////////+shmdh+/+oooshdNNNNNNNNmdhydmMmddhhhdh\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhdmNMMMNdhsssysoyhmMMNdy+::::::::::::::::::::::::oydNmyssssssyyyhdNhy://///////////////+/+//+oooyhNNNNNNNNNddyhmMmdhhhhhhh\n" +
"hhhhhhhhhyhyyhhhhhhhhhhhhhhhhhhhhdmNMMNNddhsddmdmMMNmy+/:::::::::::::::::::::/yhNNhyyyyyyyyhddNhs//////////////////////+oooshdMNNNNNNNmdyhdNmdhyhhhhhh\n" +
"hhyyyyyyyyyyyyyhhhhhhhyhhhhhhhhhhhhhhddmNMMMMMmdhdNMMNmho/::::::::::::::::::::oydNNmhhyyyyhhdNmh+/////////////////////+ooooyhNNNNNNNNNdhhdNNdhyyhhyyhy\n" +
"hhhhhyhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdddhhhhhdNMMNmhs+/:::::::::::://++oshdNMMMNmmmmNNMMMNmhyso+++++++++++ooooooooooyhmNNNNNNNNmdddNNdhhyyhhyhhy\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhmMMMNmdddhhhhhhhddmmmNNMMMMMMMNNNNMMMMMNNNMMMMMMNmdhhysoooooooooooosshdNNNNNNNNmdmdmNddhhhhhhhhhh\n" +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhmMMMNNmmmNNNNNNNNNNMMMNhhmmyshdmNmmMMNNNNNNNNNMMMMMMMMMNNNNmmmNNNMMMMNNNNNNNNdmmmNddhhhhhhhhhhh";

}
51 changes: 34 additions & 17 deletions src/main/java/azzy/fabric/incubus_core/datagen/RecipeJsonGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,46 @@
import net.minecraft.util.registry.Registry;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

@SuppressWarnings("unused")
public class RecipeJsonGen {

public static final String PATTERN_PATH = "pattern";

public static final String SMELTING_TEMPLATE = "{\n" +
" \"type\": \"minecraft:smelting\",\n" +
" \"ingredient\": {\n" +
" \"item\": \"component_0\"\n" +
" },\n" +
" \"result\": \"component_1\",\n" +
" \"experience\": component_2,\n" +
" \"cookingtime\": component_3\n" +
"}";

public static void genFurnaceRecipe(Metadata metadata, String name, Item input, Item output, float xp, int time) {
genDynamicRecipe(
metadata,
name,
"smelting",
SMELTING_TEMPLATE,
new String[]{ Registry.ITEM.getId(input).toString(), Registry.ITEM.getId(output).toString(), String.valueOf(xp), String.valueOf(time)}
);
}

public static void genDynamicRecipe(Metadata metadata, String name, String category, String template, String[] components) {
String output = "" + template;
for (int i = 0; i < components.length; i++) {
output = output.replace("component_" + i, components[i]);
}
try {
FileUtils.writeStringToFile(metadata.genDataJson(name, PATTERN_PATH + File.separator + category, Metadata.DataType.RECIPE), output, Charsets.UTF_8);
} catch (IOException e) {
e.printStackTrace();
}
}

public static void gen2x2Recipe(Metadata metadata, String name, Item in, Item out, int count) {

String output = Registry.ITEM.getId(out).toString();
Expand All @@ -33,23 +67,6 @@ public static void gen2x2Recipe(Metadata metadata, String name, Item in, Item ou
" }\n" +
"}";

//"{\n" +
// " \"type\": \"minecraft:crafting_shaped\",\n" +
// " \"pattern\": [\n" +
// " \"###\",\n" +
// " \"# #\",\n" +
// " \"###\"\n" +
// " ],\n" +
// " \"key\": {\n" +
// " \"#\": {\n" +
// " \"tag\": \"minecraft:planks\"\n" +
// " }\n" +
// " },\n" +
// " \"result\": {\n" +
// " \"item\": \"minecraft:chest\"\n" +
// " }\n" +
// "}"

try {
FileUtils.writeStringToFile(metadata.genDataJson(name, PATTERN_PATH, Metadata.DataType.RECIPE), json, Charsets.UTF_8);
} catch (IOException e) {
Expand Down

0 comments on commit 5f7fb2e

Please sign in to comment.