diff --git a/kubejs/server_scripts/HarmoniousEngineering/portable_woodcutter.js b/kubejs/server_scripts/HarmoniousEngineering/portable_woodcutter.js index 53d1246..ef7ac2a 100644 --- a/kubejs/server_scripts/HarmoniousEngineering/portable_woodcutter.js +++ b/kubejs/server_scripts/HarmoniousEngineering/portable_woodcutter.js @@ -38,11 +38,15 @@ onEvent("player.inventory.opened", (event) => { // Prevents ever placing the acacia woodcutter. Causes item to desync out of your inv so the next event fixes that onEvent("block.right_click", (event) => { - if (event.getItem() === "corail_woodcutter:acacia_woodcutter") { + const player = event.getEntity(); + const playerEntity = player.minecraftPlayer; + if (event.getItem() === "corail_woodcutter:oak_woodcutter") { + if (playerEntity.func_225608_bj_() || player.isCrouching()) { + event.cancel(); + } + } else if (event.getItem() === "corail_woodcutter:acacia_woodcutter") { event.cancel(); - const player = event.getEntity(); - const playerEntity = player.minecraftPlayer; playerEntity.func_226284_e_(true); // setSneaking const portableWoodcutter = Item.of("corail_woodcutter:acacia_woodcutter"); diff --git a/kubejs/server_scripts/HarmoniousEngineering/recipes/corailwoodcutter.js b/kubejs/server_scripts/HarmoniousEngineering/recipes/corailwoodcutter.js index a1473dd..0538642 100644 --- a/kubejs/server_scripts/HarmoniousEngineering/recipes/corailwoodcutter.js +++ b/kubejs/server_scripts/HarmoniousEngineering/recipes/corailwoodcutter.js @@ -28,4 +28,25 @@ onEvent("recipes", (event) => { B: "#harmeng:saw_blade", P: "#minecraft:planks", }); + + event.custom({ + type: "portable_stonecutter:anvil_flattening", + ingredients: [ + { + tag: "minecraft:wooden_pressure_plates", + }, + { + item: "minecraft:redstone", + }, + { + item: "minecraft:redstone", + }, + { + item: "corail_woodcutter:oak_woodcutter", + }, + ], + output: { + item: "corail_woodcutter:acacia_woodcutter", + }, + }); });