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)
This commit is contained in:
Beanzilla 2021-05-07 12:17:06 -04:00 committed by GitHub
parent b69ec3362a
commit eb2f4192aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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