make signs_lib optional for base homedecor mod

This commit is contained in:
Vanessa Ezekowitz 2014-11-22 15:42:15 -05:00
parent 3e91d0cef3
commit 5d078198f2
2 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,5 @@
default default
signs_lib
building_blocks building_blocks
signs_lib?
moreblocks? moreblocks?

View File

@ -1,5 +1,19 @@
-- This file adds fences of various types -- This file adds fences of various types
local signs_modpath = minetest.get_modpath("signs_lib")
local sign_post_model = {
type = "fixed",
fixed = {
{-0.4375, -0.25, -0.1875, 0.4375, 0.375, -0.125},
{-0.125, -0.5, -0.125, 0.125, 0.5, 0.125},
}
}
if signs_modpath then
sign_post_model = signs_lib.sign_post_model.nodebox
end
local S = homedecor.gettext local S = homedecor.gettext
minetest.register_node("homedecor:fence_brass", { minetest.register_node("homedecor:fence_brass", {
@ -50,7 +64,7 @@ minetest.register_node("homedecor:fence_brass_with_sign", {
wield_image = "homedecor_sign_brass_post.png", wield_image = "homedecor_sign_brass_post.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = signs_lib.sign_post_model.nodebox, node_box = sign_post_model,
groups = {snappy=3,not_in_creative_inventory=1}, groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
walkable = true, walkable = true,
@ -78,7 +92,7 @@ minetest.register_node("homedecor:fence_wrought_iron_with_sign", {
wield_image = "homedecor_sign_wrought_iron_post.png", wield_image = "homedecor_sign_wrought_iron_post.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = signs_lib.sign_post_model.nodebox, node_box = sign_post_model,
groups = {snappy=3,not_in_creative_inventory=1}, groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
walkable = true, walkable = true,
@ -494,5 +508,8 @@ minetest.register_node("homedecor:fence_wrought_iron_2_corner", {
}, },
}) })
signs_lib.register_fence_with_sign("homedecor:fence_brass", "homedecor:fence_brass_with_sign") if signs_modpath then
signs_lib.register_fence_with_sign("homedecor:fence_wrought_iron", "homedecor:fence_wrought_iron_with_sign") signs_lib.register_fence_with_sign("homedecor:fence_brass", "homedecor:fence_brass_with_sign")
signs_lib.register_fence_with_sign("homedecor:fence_wrought_iron", "homedecor:fence_wrought_iron_with_sign")
end