1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-22 16:10:18 +01:00

update to use new signs_lib API -- requires signs_lib commit 4ff54c9a and above

This commit is contained in:
Vanessa Dannenberg 2019-09-11 12:28:24 -04:00
parent 8532dee8ed
commit d897e6d97c
2 changed files with 22 additions and 54 deletions

View File

@ -2,4 +2,4 @@ homedecor_common
default default
basic_materials basic_materials
dye dye
signs_lib? basic_signs?

View File

@ -1,19 +1,5 @@
-- 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
local materials = { local materials = {
@ -23,43 +9,17 @@ local materials = {
for _, m in ipairs(materials) do for _, m in ipairs(materials) do
local desc, name = unpack(m) local desc, name = unpack(m)
homedecor.register("fence_"..name, { homedecor.register("fence_"..name, {
description = S("Fence/railing (@1)", desc), description = S("Fence/railing (@1)", desc),
drawtype = "fencelike", drawtype = "fencelike",
tiles = {"homedecor_generic_metal_"..name..".png"}, tiles = {"homedecor_generic_metal_"..name..".png"},
inventory_image = "homedecor_fence_"..name..".png", inventory_image = "homedecor_fence_"..name..".png",
selection_box = homedecor.nodebox.bar_y(1/7), selection_box = homedecor.nodebox.bar_y(1/7),
groups = {snappy=3}, groups = {snappy=3},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
-- brass/wrought iron with signs:
homedecor.register("fence_"..name.."_with_sign", {
description = S("Fence/railing with sign (@1)", desc),
tiles = {
"homedecor_sign_"..name.."_post_top.png",
"homedecor_sign_"..name.."_post_bottom.png",
"homedecor_sign_"..name.."_post_side.png",
"homedecor_sign_"..name.."_post_side.png",
"homedecor_sign_"..name.."_post_back.png",
"homedecor_sign_"..name.."_post_front.png",
},
wield_image = "homedecor_sign_"..name.."_post.png",
node_box = sign_post_model,
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
sunlight_propagates = true,
drop = {
max_items = 2,
items = {
{ items = { "default:sign_wall" }},
{ items = { "homedecor:fence_"..name }},
},
},
})
end end
@ -303,9 +263,17 @@ homedecor.register("fence_wrought_iron_2_corner", {
}, },
}) })
if signs_modpath then -- insert the old wood signs-on-metal-fences into signs_lib's conversion LBM
signs_lib.register_fence_with_sign("homedecor:fence_brass", "homedecor:fence_brass_with_sign") if minetest.get_modpath("basic_signs") then
signs_lib.register_fence_with_sign("homedecor:fence_wrought_iron", "homedecor:fence_wrought_iron_with_sign") table.insert(signs_lib.old_fenceposts_with_signs, "homedecor:fence_brass_with_sign")
signs_lib.old_fenceposts["homedecor:fence_brass_with_sign"] = "homedecor:fence_brass"
signs_lib.old_fenceposts_replacement_signs["homedecor:fence_brass_with_sign"] = "default:sign_wall_wood_onpole"
table.insert(signs_lib.old_fenceposts_with_signs, "homedecor:fence_wrought_iron_with_sign")
signs_lib.old_fenceposts["homedecor:fence_wrought_iron_with_sign"] = "homedecor:fence_wrought_iron"
signs_lib.old_fenceposts_replacement_signs["homedecor:fence_wrought_iron_with_sign"] = "default:sign_wall_wood_onpole"
signs_lib.allowed_poles["homedecor:pole_brass"] = true
end end
-- crafting -- crafting