From eb2f4192aa0f3b365681039e482ce8d89a743ad8 Mon Sep 17 00:00:00 2001 From: Beanzilla Date: Fri, 7 May 2021 12:17:06 -0400 Subject: [PATCH] Prevented a collision with durapick and moreblocks We both were defining something that took group:wood times 9 and returned something. Now if moreblocks is installed too we just use moreblocks:wood_tile (Same recipe so same resource) --- wood.lua | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/wood.lua b/wood.lua index 46f7df5..18942cd 100644 --- a/wood.lua +++ b/wood.lua @@ -1,3 +1,6 @@ +local default = rawget(_G, "default") or {} +local morebocks = rawget(_G, "moreblocks") or {} + -- Make such a thing minetest.register_tool("durapick:wood_pick", { description = "Durable Wooden Pickaxe", @@ -15,17 +18,28 @@ minetest.register_tool("durapick:wood_pick", { groups = {pickaxe = 1} }) -minetest.register_craft({ - type = "shaped", - output = "durapick:wood_pick 1", - recipe = { -- Use globals to allow customized recipes - {durapick_resource_wood_post, durapick_resource_wood_post, durapick_resource_wood_post}, - {"", durapick_stick, ""}, - {"", durapick_stick, ""} - }, -}) - -default = rawget(_G, "default") or {} +if moreblocks == nil then + minetest.register_craft({ + type = "shaped", + output = "durapick:wood_pick 1", + recipe = { -- Use globals to allow customized recipes + {durapick_resource_wood_post, durapick_resource_wood_post, durapick_resource_wood_post}, + {"", durapick_stick, ""}, + {"", durapick_stick, ""} + }, + }) +else + minetest.register_craft({ + type = "shaped", + output = "durapick:wood_pick 1", + recipe = { -- Use more blocks instead of our own dura_wood + {"moreblocks:wood_tile", "moreblocks:wood_tile", "moreblocks:wood_tile"}, + {"", durapick_stick, ""}, + {"", durapick_stick, ""} + }, + }) + +end minetest.register_node("durapick:dura_wood", { description = "Dura Wood", paramtype2 = "facedir", @@ -38,12 +52,14 @@ minetest.register_node("durapick:dura_wood", { ItemStack("durapick:dura_wood", 99) -minetest.register_craft({ - type = "shaped", - output = "durapick:dura_wood 1", - recipe = { -- Use globals to allow customized recipes - {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre}, - {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre}, - {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre} - }, -}) +if moreblocks == nil then + minetest.register_craft({ + type = "shaped", + output = "durapick:dura_wood 1", + recipe = { -- Use globals to allow customized recipes + {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre}, + {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre}, + {durapick_resource_wood_pre, durapick_resource_wood_pre, durapick_resource_wood_pre} + }, + }) +end