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

convert homedecor_fences

This commit is contained in:
unknown 2022-04-02 22:06:56 -04:00
parent 63439e19ea
commit 9cd32667c3
4 changed files with 227 additions and 233 deletions

View File

@ -14,10 +14,12 @@ homedecor.materials = {
empty_bucket = "bucket:bucket_empty",
dye_dark_grey = "dye:dark_grey",
dye_black = "dye:black",
dye_white = "dye:white",
silicon = "mesecons_materials:silicon",
string = "farming:string",
paper = "default:paper",
book = "default:book",
iron_lump = "default:iron_lump",
}
if minetest.get_modpath("moreores") then
@ -59,12 +61,14 @@ elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then
empty_bucket = "fl_bucket:bucket",
dye_dark_grey = "fl_dyes:dark_grey_dye",
dye_black = "fl_dyes:black_dye",
dye_white = "fl_dye:white_dye",
copper_ingot = "fl_ores:copper_ingot",
tin_ingot = "fl_ores:tin_ingot",
silver_ingot = "fl_ores:iron_ingot",
silicon = "mesecons_materials:silicon",
string = "fl_plantlife:oxeye_daisy",
paper = "basic_materials:plastic_sheet",
iron_lump = "fl_ores:iron_ore",
}
elseif minetest.get_modpath("hades_core") then
homedecor.materials = {

View File

@ -1,21 +0,0 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"default",
"homedecor",
}
globals = {
"signs_lib",
}

View File

@ -2,14 +2,30 @@
local S = minetest.get_translator("homedecor_fences")
local brass = {
output = "homedecor:fence_brass 6",
recipe = {
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
},
}
local iron = {
output = "homedecor:fence_wrought_iron 6",
recipe = {
{ "iron_lump","iron_lump","iron_lump" },
{ "iron_lump","iron_lump","iron_lump" },
},
}
local materials = {
{ S("brass"), "brass" },
{ S("wrought iron"), "wrought_iron" },
{ S("brass"), "brass", brass },
{ S("wrought iron"), "wrought_iron", iron },
}
for _, m in ipairs(materials) do
local desc, name = unpack(m)
local desc, name, craft = unpack(m)
homedecor.register("fence_"..name, {
description = S("Fence/railing (@1)", desc),
@ -17,8 +33,13 @@ for _, m in ipairs(materials) do
tiles = {"homedecor_generic_metal_"..name..".png"},
inventory_image = "homedecor_fence_"..name..".png",
selection_box = homedecor.nodebox.bar_y(1/7),
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_stone=3},
_sound_def = {
key = "node_sound_wood_defaults",
},
crafts = {
craft
}
})
end
@ -36,10 +57,29 @@ homedecor.register("fence_picket", {
"homedecor_fence_picket.png"
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-0.1),
node_box = homedecor.nodebox.slab_z(-0.002),
crafts = {
{
output = "homedecor:fence_picket 6",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "group:stick", "group:stick" }
},
},
{
type = "shapeless",
output = "homedecor:fence_picket 2",
recipe = {
"homedecor:fence_picket_corner"
},
}
}
})
homedecor.register("fence_picket_corner", {
@ -53,10 +93,21 @@ homedecor.register("fence_picket_corner", {
"homedecor_fence_picket.png",
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.corner_xz(0.1, -0.1),
node_box = homedecor.nodebox.corner_xz(0.002, -0.002),
crafts = {
{
type = "shapeless",
recipe = {
"homedecor:fence_picket",
"homedecor:fence_picket"
},
},
}
})
homedecor.register("fence_picket_white", {
@ -70,10 +121,29 @@ homedecor.register("fence_picket_white", {
"homedecor_fence_picket_white.png"
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-0.1),
node_box = homedecor.nodebox.slab_z(-0.002),
crafts = {
{
output = "homedecor:fence_picket_white 6",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "dye_white", "group:stick" },
{ "group:stick", "group:stick", "group:stick" }
},
},
{
type = "shapeless",
output = "homedecor:fence_picket_white 2",
recipe = {
"homedecor:fence_picket_corner_white"
},
}
}
})
homedecor.register("fence_picket_corner_white", {
@ -87,10 +157,21 @@ homedecor.register("fence_picket_corner_white", {
"homedecor_fence_picket_white.png",
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.corner_xz(0.1, -0.1),
node_box = homedecor.nodebox.corner_xz(0.002, -0.002),
crafts = {
{
type = "shapeless",
recipe = {
"homedecor:fence_picket_white",
"homedecor:fence_picket_white"
},
}
}
})
homedecor.register("fence_privacy", {
@ -103,8 +184,10 @@ homedecor.register("fence_privacy", {
"homedecor_fence_privacy_backside.png",
"homedecor_fence_privacy_front.png"
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-3/16),
node_box = {
type = "fixed",
@ -115,6 +198,23 @@ homedecor.register("fence_privacy", {
{ -8/16, -2/16, 7/16, 8/16, 2/16, 8/16 }, -- connecting rung
}
},
crafts = {
{
output = "homedecor:fence_privacy 6",
recipe = {
{ "group:wood", "group:stick", "group:wood" },
{ "group:wood", "", "group:wood" },
{ "group:wood", "group:stick", "group:wood" }
},
},
{
type = "shapeless",
output = "homedecor:fence_privacy 2",
recipe = {
"homedecor:fence_privacy_corner"
},
}
}
})
homedecor.register("fence_privacy_corner", {
@ -127,8 +227,10 @@ homedecor.register("fence_privacy_corner", {
"homedecor_fence_privacy_backside.png",
"homedecor_fence_privacy_corner_front.png"
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = {
type = "fixed",
fixed = {
@ -150,6 +252,15 @@ homedecor.register("fence_privacy_corner", {
{ -8/16, -2/16, -8/16, -7/16, 2/16, 7/16 }, -- left-side connecting rung
}
},
crafts = {
{
type = "shapeless",
recipe = {
"homedecor:fence_privacy",
"homedecor:fence_privacy"
},
},
}
})
homedecor.register("fence_barbed_wire", {
@ -157,10 +268,27 @@ homedecor.register("fence_barbed_wire", {
mesh = "homedecor_fence_barbed_wire.obj",
tiles = {"homedecor_fence_barbed_wire.png"},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-0.125),
collision_box = homedecor.nodebox.slab_z(-0.125),
crafts = {
{
output = "homedecor:fence_barbed_wire 6",
recipe = {
{ "group:stick", "basic_materials:steel_wire", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "basic_materials:steel_wire", "group:stick" }
},
},
{
type = "shapeless",
output = "homedecor:fence_barbed_wire 2",
recipe = { "homedecor:fence_barbed_wire_corner" },
}
}
})
homedecor.register("fence_barbed_wire_corner", {
@ -168,10 +296,18 @@ homedecor.register("fence_barbed_wire_corner", {
mesh = "homedecor_fence_barbed_wire_corner.obj",
tiles = { "homedecor_fence_barbed_wire.png" },
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_tree=2},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.corner_xz(0.125, -0.125),
collision_box = homedecor.nodebox.corner_xz(0.125, -0.125),
crafts = {
{
type = "shapeless",
recipe = { "homedecor:fence_barbed_wire", "homedecor:fence_barbed_wire" },
}
}
})
homedecor.register("fence_chainlink", {
@ -186,10 +322,27 @@ homedecor.register("fence_chainlink", {
"homedecor_fence_chainlink_fb.png",
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_stone=3},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-0.125),
collision_box = homedecor.nodebox.slab_z(-0.125),
crafts = {
{
output = "homedecor:fence_chainlink 9",
recipe = {
{ "steel_ingot", "steel_ingot", "steel_ingot" },
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "steel_ingot" },
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "steel_ingot" }
},
},
{
type = "shapeless",
output = "homedecor:fence_chainlink 2",
recipe = { "homedecor:fence_chainlink_corner" },
}
}
})
@ -205,10 +358,18 @@ homedecor.register("fence_chainlink_corner", {
"homedecor_fence_chainlink_corner_front.png",
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_stone=3},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.corner_xz(0.125, -0.125),
collision_box = homedecor.nodebox.corner_xz(0.125, -0.125),
crafts = {
{
type = "shapeless",
recipe = { "homedecor:fence_chainlink", "homedecor:fence_chainlink" },
}
}
})
homedecor.register("fence_wrought_iron_2", {
@ -222,8 +383,10 @@ homedecor.register("fence_wrought_iron_2", {
"homedecor_fence_wrought_iron_2_fb.png"
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_stone=3},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.slab_z(-0.08),
node_box = {
type = "fixed",
@ -237,6 +400,22 @@ homedecor.register("fence_wrought_iron_2", {
{ -8/16, -8/16, 15/32, 8/16, 8/16, 15/32 } -- the grid itself
}
},
crafts = {
{
output = "homedecor:fence_wrought_iron_2 4",
recipe = {
{ "homedecor:pole_wrought_iron", "iron_lump" },
{ "homedecor:pole_wrought_iron", "iron_lump" },
},
}
},
{
type = "shapeless",
output = "homedecor:fence_wrought_iron_2 2",
recipe = {
"homedecor:fence_wrought_iron_2_corner",
},
}
})
homedecor.register("fence_wrought_iron_2_corner", {
@ -250,8 +429,10 @@ homedecor.register("fence_wrought_iron_2_corner", {
"homedecor_fence_corner_wrought_iron_2_sides.png"
},
use_texture_alpha = "clip",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
groups = {snappy=3, dig_stone=3},
_sound_def = {
key = "node_sound_wood_defaults",
},
selection_box = homedecor.nodebox.corner_xz(0.08, -0.08),
node_box = {
type = "fixed",
@ -271,10 +452,20 @@ homedecor.register("fence_wrought_iron_2_corner", {
{ -15.25/32, -0.015625, -0.5, -14.75/32, 0.015625, 0.5 } -- cross piece side
}
},
crafts = {
{
type = "shapeless",
output = "homedecor:fence_wrought_iron_2_corner",
recipe = {
"homedecor:fence_wrought_iron_2",
"homedecor:fence_wrought_iron_2"
},
}
}
})
-- insert the old wood signs-on-metal-fences into signs_lib's conversion LBM
if minetest.get_modpath("signs_lib") then
if minetest.get_modpath("signs_lib") and minetest.get_modpath("default") then
-- FIXME: export a function in signs_lib API to allow signs_lib to be read only in .luacheckrc
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"
@ -284,183 +475,3 @@ if minetest.get_modpath("signs_lib") then
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"
end
-- crafting
-- Brass/wrought iron fences
minetest.register_craft( {
output = "homedecor:fence_brass 6",
recipe = {
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
},
})
minetest.register_craft( {
output = "homedecor:fence_wrought_iron 6",
recipe = {
{ "default:iron_lump","default:iron_lump","default:iron_lump" },
{ "default:iron_lump","default:iron_lump","default:iron_lump" },
},
})
-- other types of fences
minetest.register_craft( {
output = "homedecor:fence_wrought_iron_2 4",
recipe = {
{ "homedecor:pole_wrought_iron", "default:iron_lump" },
{ "homedecor:pole_wrought_iron", "default:iron_lump" },
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_wrought_iron_2_corner",
recipe = {
"homedecor:fence_wrought_iron_2",
"homedecor:fence_wrought_iron_2"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_wrought_iron_2 2",
recipe = {
"homedecor:fence_wrought_iron_2_corner",
},
})
--
minetest.register_craft( {
output = "homedecor:fence_picket 6",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "group:stick", "group:stick" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_picket_corner",
recipe = {
"homedecor:fence_picket",
"homedecor:fence_picket"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_picket 2",
recipe = {
"homedecor:fence_picket_corner"
},
})
--
minetest.register_craft( {
output = "homedecor:fence_picket_white 6",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "dye:white", "group:stick" },
{ "group:stick", "group:stick", "group:stick" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_picket_corner_white",
recipe = {
"homedecor:fence_picket_white",
"homedecor:fence_picket_white"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_picket_white 2",
recipe = {
"homedecor:fence_picket_corner_white"
},
})
--
minetest.register_craft( {
output = "homedecor:fence_privacy 6",
recipe = {
{ "group:wood", "group:stick", "group:wood" },
{ "group:wood", "", "group:wood" },
{ "group:wood", "group:stick", "group:wood" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_privacy_corner",
recipe = {
"homedecor:fence_privacy",
"homedecor:fence_privacy"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_privacy 2",
recipe = {
"homedecor:fence_privacy_corner"
},
})
--
minetest.register_craft( {
output = "homedecor:fence_barbed_wire 6",
recipe = {
{ "group:stick", "basic_materials:steel_wire", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "basic_materials:steel_wire", "group:stick" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_barbed_wire_corner",
recipe = { "homedecor:fence_barbed_wire", "homedecor:fence_barbed_wire" },
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_barbed_wire 2",
recipe = { "homedecor:fence_barbed_wire_corner" },
})
--
minetest.register_craft( {
output = "homedecor:fence_chainlink 9",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "default:steel_ingot" },
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "default:steel_ingot" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_chainlink_corner",
recipe = { "homedecor:fence_chainlink", "homedecor:fence_chainlink" },
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_chainlink 2",
recipe = { "homedecor:fence_chainlink_corner" },
})

View File

@ -1,4 +1,4 @@
name = homedecor_fences
description = Homedecor mod: fences
depends = homedecor_common, default, basic_materials, dye
optional_depends = signs_lib
depends = homedecor_common
optional_depends = signs_lib, default, basic_materials, dye