Skip to content

Commit

Permalink
Refactoring wooden_stuff.lua: unify stanchion registration & names.…
Browse files Browse the repository at this point in the history
… Relates to #1233
  • Loading branch information
alek13 committed Feb 23, 2024
1 parent c3ca79e commit 54998b8
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions mods/lord/Blocks/lottblocks/wooden_stuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
node_groups["wood"] = nil
node_groups["wooden"] = 1

local stick_reg_name

if name ~= "wood" then -- in order to not overwrite registrations from minetest_game

-- DOORs | ДВЕРЬ
Expand All @@ -414,16 +416,16 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
register_fence(name, description, wood_name, node_groups)

-- STICK | ПАЛОЧКА
local stick_reg_name =
stick_reg_name =
register_stick(name, description, wood_name)

-- LADDER | ЛЕСТНИЦА
register_ladder(name, description, stick_reg_name)

-- STANCHION | СТОЙКИ
register_stanchion(name, description, texture, node_groups, stick_reg_name)
end

-- STANCHION | СТОЙКИ
register_stanchion(name, description, texture, node_groups, stick_reg_name or "default:stick")

-- TABLE | СТОЛ
register_table(name, description, texture, wood_name, node_groups)

Expand All @@ -441,35 +443,5 @@ lottblocks.register_wooden_stuff("lebethron", "Lebethron", "lottplants_lebethron
lottblocks.register_wooden_stuff("mallorn", "Mallorn", "lottplants_mallornwood.png", "lottplants:mallornwood")
lottblocks.register_wooden_stuff("hardwood", "Hardwood", "lottblocks_hardwood.png", "lord_homedecor:hardwood")

minetest.register_alias("lottblocks:wooden_stanchion", "lottblocks:wood_stanchion")
minetest.register_alias("lottblocks:fence_junglewood", "default:fence_junglewood")


--***********************************************************
--** WOODEN STANCHION | СТОЙКИ ИЗ ЯБЛОНИ **
--***********************************************************
minetest.register_node("lottblocks:wooden_stanchion", {
description = S("Wooden Stanchion"),
tiles = { "default_wood.png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, -0.4, 0.5, -0.4 },
{ 0.4, -0.5, -0.5, 0.5, 0.5, -0.4 },
{ -0.5, -0.5, 0.4, -0.4, 0.5, 0.5 },
{ 0.4, -0.5, 0.4, 0.5, 0.5, 0.5 },
},
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}
})
minetest.register_craft({
output = "lottblocks:wooden_stanchion",
recipe = {
{ 'default:stick', '', 'default:stick' },
{ '', '', '' },
{ 'default:stick', '', 'default:stick' },
}
})

0 comments on commit 54998b8

Please sign in to comment.