Created
May 22, 2025 17:27
-
-
Save XerShade/5ae508b2559d6f53876679f46a7b682d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string OUTPUT_PATH = "PATH_TO_DATAPACK\\NAMESPACE\\recipe"; | |
const string STRIPED_LOG_TEMPLATE = "{\r\n \"type\": \"minecraft:stonecutting\",\r\n \"ingredient\": [\r\n \"minecraft:{LOG_TYPE}_{WOOD_TYPE}\"\r\n ],\r\n \"result\": {\r\n \"id\": \"minecraft:stripped_{LOG_TYPE}_{WOOD_TYPE}\",\r\n \"count\": 1\r\n }\r\n}"; | |
string[] WOOD_TYPES = ["wood", "log"]; | |
string[] LOG_TYPES = ["acacia", "birch", "spruce", "oak", "dark_oak", "jungle", "cherry", "mangrove", "pale_oak"]; | |
string[] NETHER_WOOD_TYPES = ["hyphae", "stem"]; | |
string[] NETHER_LOG_TYPES = ["crimson", "warped"]; | |
string[] BAMBOO_WOOD_TYPES = ["block"]; | |
string[] BAMBOO_LOG_TYPES = ["bamboo"]; | |
foreach (string wood_type in WOOD_TYPES) | |
{ | |
foreach (string log_type in LOG_TYPES) | |
{ | |
Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'."); | |
string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type); | |
string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json"); | |
StreamWriter fs = new(path, false); | |
fs.WriteLine(recipe); | |
fs.Close(); | |
} | |
} | |
foreach (string wood_type in NETHER_WOOD_TYPES) | |
{ | |
foreach (string log_type in NETHER_LOG_TYPES) | |
{ | |
Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'."); | |
string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type); | |
string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json"); | |
StreamWriter fs = new(path, false); | |
fs.WriteLine(recipe); | |
fs.Close(); | |
} | |
} | |
foreach (string wood_type in BAMBOO_WOOD_TYPES) | |
{ | |
foreach (string log_type in BAMBOO_LOG_TYPES) | |
{ | |
Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'."); | |
string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type); | |
string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json"); | |
StreamWriter fs = new(path, false); | |
fs.WriteLine(recipe); | |
fs.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment