You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
427 lines
15 KiB
427 lines
15 KiB
// priority: 0 |
|
|
|
onEvent("recipes", event => { |
|
event.stonecutting("2x minecraft:stick", "#minecraft:planks"); |
|
event.stonecutting("2x minecraft:bowl" , "#minecraft:planks"); |
|
event.stonecutting("tconstruct:pattern", "#minecraft:planks"); |
|
|
|
let COSTS = { |
|
// Logs |
|
wood: { log: 1 }, |
|
stripped_log: { log: 1 }, |
|
stripped_wood: { log: 1, wood: 1, stripped_log: 1, }, |
|
// Items from Logs |
|
planks: { any_log: 4 }, |
|
boat: { any_log: 1 }, |
|
beam: { any_log: 1 }, |
|
palisade: { any_log: 4 }, |
|
post: { log: 4, wood: 4 }, |
|
stripped_post: { any_log: 4 }, |
|
// Items from Planks |
|
stairs: { planks: 1 }, |
|
slab: { planks: 2 }, |
|
ladder: { planks: 2 }, |
|
door: { planks: 1 }, |
|
trapdoor: { planks: 1 }, |
|
fence: { planks: 1 }, |
|
fence_gate: { planks: 1 }, |
|
button: { planks: 4 }, |
|
pressure_plate: { planks: 2 }, |
|
sign: { planks: 1 }, |
|
support: { planks: 1 }, |
|
seat: { planks: 1 }, |
|
vertical_planks: { planks: 1, any_log: 4 }, |
|
vertical_slab: { planks: 2 }, |
|
chair: { planks: 1 }, |
|
table: { planks: 1 }, |
|
shelf: { planks: 1 }, |
|
bench: { planks: 2 }, |
|
backpack_shelf: { planks: 2 }, |
|
banister: { planks: 2 }, |
|
}; |
|
|
|
let WOOD_TYPES = { |
|
minecraft: [ "oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "crimson", "warped" ], |
|
biomesoplenty: [ "cherry", "dead", "fir", "hellbark", "jacaranda", "magic", "mahogany", "palm", "redwood", "umbran", "willow" ], |
|
botania: [ "livingwood", "dreamwood" ], |
|
nourished_end: [ "seldge", "verdant", "cerulean" ], |
|
malum: [ "runewood", "soulwood" ], |
|
tconstruct: [ "greenheart", "skyroot", "bloodshroom" ], |
|
twilightforest: [ "twilight_oak", "canopy", "mangrove", "dark", "time", "transformation", "mining", "sorting" ], |
|
quark: [ "azalea", "blossom" ], |
|
}; |
|
|
|
let EVERY_COMPAT_TYPES = [ |
|
"ladder", "post", "stripped_post", "vertical_planks", |
|
"beam", "palisade", "support", "seat", |
|
"backpack_shelf", "banister", |
|
]; |
|
function makeEveryCompatFormat(mod) { return { |
|
// Quark |
|
ladder: `{MOD}:q/${mod}/{WOOD}_ladder`, |
|
post: `{MOD}:q/${mod}/{WOOD}_post`, |
|
stripped_post: `{MOD}:q/${mod}/stripped_{WOOD}_post`, |
|
vertical_planks: `{MOD}:q/${mod}/vertical_{WOOD}_planks`, |
|
// Decorative Blocks |
|
beam: `{MOD}:db/${mod}/{WOOD}_beam`, |
|
palisade: `{MOD}:db/${mod}/{WOOD}_palisade`, |
|
support: `{MOD}:db/${mod}/{WOOD}_support`, |
|
seat: `{MOD}:db/${mod}/{WOOD}_seat`, |
|
// Backpacked |
|
backpack_shelf: `{MOD}:bp/${mod}/{WOOD}_backpack_shelf`, |
|
// Twilight Forest |
|
banister: `{MOD}:tf/${mod}/{WOOD}_banister`, |
|
}; } |
|
|
|
let DEFAULT_FORMAT = { |
|
DEFAULT: "{MOD}:{WOOD}_{TYPE}", |
|
any_log: "#{MOD}:{WOOD}_logs", |
|
stripped_log: "{MOD}:stripped_{WOOD}_log", |
|
stripped_wood: "{MOD}:stripped_{WOOD}_wood", |
|
stripped_post: "{MOD}:stripped_{WOOD}_post", |
|
vertical_planks: "{MOD}:vertical_{WOOD}_planks", |
|
}; |
|
|
|
let DEFINITIONS = { |
|
// =============================== |
|
// ========== MINECRAFT ========== |
|
// =============================== |
|
minecraft: [ |
|
{ |
|
woods: WOOD_TYPES.minecraft, |
|
types: [ "planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", "sign", "button", "pressure_plate" ], |
|
}, |
|
{ |
|
woods: [ "oak", "spruce", "birch", "jungle", "acacia", "dark_oak" ], |
|
types: [ "any_log", "log", "wood", "stripped_log", "stripped_wood", "boat" ], |
|
}, |
|
{ |
|
woods: [ "crimson", "warped" ], |
|
types: [ "any_log", "log", "wood", "stripped_log", "stripped_wood" ], |
|
format: { |
|
any_log: "#{MOD}:{WOOD}_stems", |
|
log: "{MOD}:{WOOD}_stem", |
|
wood: "{MOD}:{WOOD}_hyphae", |
|
stripped_log: "{MOD}:stripped_{WOOD}_stem", |
|
stripped_wood: "{MOD}:stripped_{WOOD}_hyphae", |
|
}, |
|
}, |
|
{ |
|
woods: [ "oak" ], types: [ "ladder" ], |
|
format: { ladder: "{MOD}:{TYPE}" }, |
|
}, |
|
], |
|
// ====================================== |
|
// ========== BIOMES O' PLENTY ========== |
|
// ====================================== |
|
biomesoplenty: [ |
|
{ |
|
woods: WOOD_TYPES.biomesoplenty, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", |
|
"sign", "button", "pressure_plate", "boat", |
|
], |
|
}, |
|
], |
|
// ============================= |
|
// ========== BOTANIA ========== |
|
// ============================= |
|
botania: [ |
|
{ |
|
woods: WOOD_TYPES.botania, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "stairs", "slab", "fence", "fence_gate", |
|
], |
|
format: { |
|
wood: "{MOD}:{WOOD}", |
|
stripped_wood: "{MOD}:stripped_{WOOD}", |
|
stairs: "{MOD}:{WOOD}_planks_{TYPE}", |
|
slab: "{MOD}:{WOOD}_planks_{TYPE}", |
|
}, |
|
}, |
|
], |
|
// =================================== |
|
// ========== NOURISHED END ========== |
|
// =================================== |
|
nourished_end: [ |
|
{ |
|
woods: WOOD_TYPES.nourished_end, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "door", "trapdoor", "fence", "fence_gate", |
|
"button", "pressure_plate", |
|
], |
|
format: { |
|
// any_log: "#{MOD}:{WOOD}_stems", |
|
log: "{MOD}:{WOOD}_stem", |
|
wood: "{MOD}:{WOOD}_hyphae", |
|
stripped_log: "{MOD}:stripped_{WOOD}_stem", |
|
stripped_wood: "{MOD}:stripped_{WOOD}_hyphae", |
|
}, |
|
}, |
|
{ |
|
woods: [ "seldge" ], |
|
types: [ "stripped_log" ], |
|
format: { stripped_log: "{MOD}:stripped_{WOOD}_log" }, |
|
}, |
|
{ |
|
woods: [ "verdant" ], |
|
types: [ "any_log", "log" ], |
|
format: { |
|
any_log: "#{MOD}:{WOOD}_log", |
|
log: "{MOD}:{WOOD}_stalk", |
|
}, |
|
}, |
|
{ |
|
woods: [ "cerulean" ], |
|
types: [ "log", "wood", "stripped_log", ], |
|
format: { |
|
log: "{MOD}:{WOOD}_stem_thick", |
|
wood: "{MOD}:{WOOD}_wood", |
|
stripped_log: "{MOD}:{WOOD}_stem_stripped", |
|
}, |
|
}, |
|
], |
|
// =========================== |
|
// ========== MALUM ========== |
|
// =========================== |
|
malum: [ |
|
{ |
|
woods: WOOD_TYPES.malum, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "door", "trapdoor", "fence", "fence_gate", |
|
"sign", "boat", "vertical_planks", "beam", |
|
], |
|
format: { |
|
wood: "{MOD}:{WOOD}", |
|
stripped_wood: "{MOD}:stripped_{WOOD}", |
|
}, |
|
}, |
|
{ |
|
woods: WOOD_TYPES.malum, |
|
types: [ "stairs", "slab", "fence", "fence_gate", "button", "pressure_plate" ], |
|
format: { DEFAULT: "{MOD}:{WOOD}_planks_{TYPE}" }, |
|
}, |
|
], |
|
// ======================================== |
|
// ========== TINKERS' CONSTRUCT ========== |
|
// ======================================== |
|
tconstruct: [ |
|
{ |
|
woods: WOOD_TYPES.tconstruct, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "door", "trapdoor", "fence", "fence_gate", |
|
"sign", "button", "pressure_plate", |
|
], |
|
}, |
|
], |
|
// ===================================== |
|
// ========== TWILIGHT FOREST ========== |
|
// ===================================== |
|
twilightforest: [ |
|
{ |
|
woods: WOOD_TYPES.twilightforest, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", |
|
"sign", "button", "pressure_plate", |
|
], |
|
}, |
|
{ |
|
woods: WOOD_TYPES.minecraft.concat(WOOD_TYPES.twilightforest), |
|
types: [ "banister" ], |
|
}, |
|
{ |
|
woods: [ "dark" ], types: [ "sign", "banister" ], |
|
format: { DEFAULT: "{MOD}:darkwood_{TYPE}" }, |
|
}, |
|
{ |
|
woods: [ "time", "dark" ], types: [ "any_log" ], |
|
format: { any_log: "#{MOD}:{WOOD}wood_logs" } |
|
}, |
|
{ |
|
woods: [ "transformation" ], types: [ "any_log" ], |
|
format: { any_log: "#{MOD}:transwood_logs" } |
|
}, |
|
{ |
|
woods: [ "sorting" ], types: [ "any_log" ], |
|
format: { any_log: "#{MOD}:sortwood_logs" } |
|
}, |
|
], |
|
// =========================== |
|
// ========== QUARK ========== |
|
// =========================== |
|
quark: [ |
|
{ |
|
woods: WOOD_TYPES.quark, |
|
types: [ |
|
"any_log", "log", "wood", "stripped_log", "stripped_wood", |
|
"planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", |
|
"sign", "button", "pressure_plate", "boat", |
|
"vertical_planks", "vertical_slab", "post", "stripped_post", |
|
], |
|
format: { |
|
stairs: "{MOD}:{WOOD}_planks_{TYPE}", |
|
slab: "{MOD}:{WOOD}_planks_{TYPE}", |
|
vertical_slab: "{MOD}:{WOOD}_planks_{TYPE}", |
|
}, |
|
}, |
|
{ |
|
woods: WOOD_TYPES.minecraft, |
|
types: [ "vertical_planks", "post", "stripped_post" ], |
|
}, |
|
{ |
|
woods: WOOD_TYPES.minecraft.concat(WOOD_TYPES.quark).filter(wood => wood != "oak"), |
|
types: [ "ladder" ], |
|
}, |
|
], |
|
// ======================================= |
|
// ========== DECORATIVE BLOCKS ========== |
|
// ======================================= |
|
decorative_blocks: [ |
|
{ |
|
woods: WOOD_TYPES.minecraft, |
|
types: [ "beam", "palisade", "support", "seat" ], |
|
}, |
|
], |
|
// =========================== |
|
// ========== ADORN ========== |
|
// =========================== |
|
adorn: [ |
|
{ |
|
woods: WOOD_TYPES.minecraft, |
|
types: [ "chair", "table", "shelf", "bench" ], |
|
}, |
|
{ |
|
woods: WOOD_TYPES.biomesoplenty, |
|
types: [ "chair", "table", "shelf", "bench" ], |
|
format: { DEFAULT: "{MOD}:biomesoplenty/{WOOD}_{TYPE}" }, |
|
}, |
|
], |
|
// ================================ |
|
// ========== BACKPACKED ========== |
|
// ================================ |
|
backpacked: [ |
|
{ |
|
woods: WOOD_TYPES.minecraft, |
|
types: [ "backpack_shelf" ], |
|
}, |
|
], |
|
// ====================================== |
|
// ========== COMPAT O' PLENTY ========== |
|
// ====================================== |
|
compatoplenty: [ |
|
{ |
|
woods: WOOD_TYPES.biomesoplenty, |
|
types: [ "ladder", "vertical_planks", "vertical_slab", "post", "stripped_post" ], |
|
}, |
|
], |
|
// ================================== |
|
// ========== EVERY COMPAT ========== |
|
// ================================== |
|
everycomp: [ |
|
{ |
|
woods: WOOD_TYPES.biomesoplenty, |
|
types: [ "beam", "palisade", "support", "seat", "backpack_shelf", "banister" ], |
|
format: makeEveryCompatFormat("biomesoplenty"), |
|
}, |
|
{ |
|
woods: WOOD_TYPES.botania, |
|
types: EVERY_COMPAT_TYPES, |
|
format: makeEveryCompatFormat("botania"), |
|
}, |
|
{ |
|
woods: WOOD_TYPES.nourished_end, |
|
types: EVERY_COMPAT_TYPES, |
|
format: makeEveryCompatFormat("nourished_end"), |
|
}, |
|
{ |
|
woods: WOOD_TYPES.malum, |
|
types: [ "palisade", "support", "seat", "backpack_shelf", "banister" ], |
|
format: makeEveryCompatFormat("malum"), |
|
}, |
|
{ |
|
woods: WOOD_TYPES.tconstruct, |
|
types: EVERY_COMPAT_TYPES, |
|
format: makeEveryCompatFormat("tconstruct"), |
|
}, |
|
{ |
|
woods: WOOD_TYPES.twilightforest, |
|
types: EVERY_COMPAT_TYPES.filter(type => type != "banister"), |
|
format: makeEveryCompatFormat("twilightforest"), |
|
}, |
|
], |
|
}; |
|
|
|
let items = { }; |
|
// Collect all definitions into "items". |
|
// { oak: { planks: "minecraft:oak_planks", ... }, ... } |
|
for (let mod in DEFINITIONS) { |
|
for (let { woods, types, format } of DEFINITIONS[mod]) { |
|
format = Object.assign({ }, DEFAULT_FORMAT, format); |
|
for (let wood of woods) { |
|
let items_by_wood = items[wood] = items[wood] || { }; |
|
for (let type of types) { |
|
let item = (format[type] || format.DEFAULT) |
|
.replace("{MOD}", mod) |
|
.replace("{WOOD}", wood) |
|
.replace("{TYPE}", type); |
|
items_by_wood[type] = item; |
|
} |
|
} |
|
} |
|
} |
|
// Register stonecutting recipes based on "COSTS". |
|
for (let wood in items) { |
|
for (let [type, item] of Object.entries(items[wood])) { |
|
for (let [input, result_count] of Object.entries(COSTS[type] || { })) { |
|
let o = `${result_count}x ${item}`; |
|
let i = items[wood] && items[wood][input]; |
|
// console.log(`${wood} ${type} :: ${i} => ${o}`); |
|
if (i != null) event.stonecutting(o, i); |
|
else console.error(`Can't create ${wood} ${type} recipe for ${item} since input wasn't found`); |
|
} |
|
} |
|
} |
|
|
|
// Additional Botania wood blocks |
|
for (let wood of WOOD_TYPES.botania) { |
|
event.stonecutting(`4x botania:framed_${wood}` , `#botania:${wood}_logs`); |
|
event.stonecutting(`4x botania:pattern_framed_${wood}`, `#botania:${wood}_logs`); |
|
|
|
event.stonecutting(`botania:framed_${wood}` , `botania:${wood}_planks`); |
|
event.stonecutting(`botania:pattern_framed_${wood}`, `botania:${wood}_planks`); |
|
|
|
event.stonecutting( `botania:${wood}_stairs`, `botania:${wood}`); |
|
event.stonecutting(`2x botania:${wood}_slab` , `botania:${wood}`); |
|
event.stonecutting( `botania:${wood}_wall` , `botania:${wood}`); |
|
|
|
event.stonecutting( `botania:stripped_${wood}_stairs`, `botania:stripped_${wood}`); |
|
event.stonecutting(`2x botania:stripped_${wood}_slab` , `botania:stripped_${wood}`); |
|
event.stonecutting( `botania:stripped_${wood}_wall` , `botania:stripped_${wood}`); |
|
} |
|
|
|
// Additional Malum wood blocks |
|
for (let wood of WOOD_TYPES.malum) { |
|
event.stonecutting(`4x malum:${wood}_panel`, `#malum:${wood}_logs`); |
|
event.stonecutting(`4x malum:${wood}_tiles`, `#malum:${wood}_logs`); |
|
|
|
event.stonecutting(`malum:${wood}_panel`, `malum:${wood}_planks`); |
|
event.stonecutting(`malum:${wood}_tiles`, `malum:${wood}_planks`); |
|
event.stonecutting(`malum:${wood}_tiles`, `malum:${wood}_panel`); |
|
|
|
event.stonecutting(`2x malum:vertical_${wood}_planks_slab`, `malum:vertical_${wood}_planks`); |
|
event.stonecutting(`2x malum:${wood}_panel_slab`, `malum:${wood}_panel`); |
|
event.stonecutting(`2x malum:${wood}_tiles_slab`, `malum:${wood}_tiles`); |
|
|
|
event.stonecutting(`malum:vertical_${wood}_planks_stairs`, `malum:vertical_${wood}_planks`); |
|
event.stonecutting(`malum:${wood}_panel_stairs`, `malum:${wood}_panel`); |
|
event.stonecutting(`malum:${wood}_tiles_stairs`, `malum:${wood}_tiles`); |
|
|
|
event.stonecutting(`malum:solid_${wood}_trapdoor`, `malum:${wood}_planks`); |
|
} |
|
});
|
|
|