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.
26 lines
1.2 KiB
26 lines
1.2 KiB
// priority: 0 |
|
|
|
onEvent("recipes", event => { |
|
// Get all (non-weighted) pressure plates and replace their input with slabs instead of blocks. |
|
event.forEachRecipe({ id: /pressure_plate/, type: "minecraft:crafting_shaped" }, recipe => { |
|
if (recipe.getPath().contains("_weighted_")) return; |
|
if (recipe.getId() == "quark:automation/crafting/obsidian_pressure_plate") return; |
|
|
|
let oldInput = recipe.inputItems[0].getId(); |
|
let newInput = oldInput + "_slab"; |
|
|
|
// Most mods will just call their slabs "<material>_slab" but some still append "_planks" and such. |
|
let mod = recipe.getMod(); |
|
if ((mod != "malum") && (mod != "tconstruct") && (mod != "quark")) |
|
newInput = newInput.replace("_block", "").replace("_planks", ""); |
|
|
|
recipe.replaceInput(oldInput, newInput, false); |
|
}); |
|
|
|
// Do the same for Twilight Forest's pressure plates (which use "_plate" in their recipe name). |
|
event.forEachRecipe({ id: /^twilightforest:.*_plate$/, type: "minecraft:crafting_shaped" }, recipe => { |
|
let oldInput = recipe.inputItems[0].getId(); |
|
let newInput = oldInput.replace("_planks", "_slab"); |
|
recipe.replaceInput(oldInput, newInput, false); |
|
}); |
|
});
|
|
|