Skip to content

Commit 686fdb5

Browse files
authored
Add different woods to mese posts (#2599)
1 parent 0a96bac commit 686fdb5

6 files changed

+77
-28
lines changed

mods/default/crafting.lua

-9
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,6 @@ minetest.register_craft({
300300
}
301301
})
302302

303-
minetest.register_craft({
304-
output = "default:mese_post_light 3",
305-
recipe = {
306-
{"", "default:glass", ""},
307-
{"default:mese_crystal", "default:mese_crystal", "default:mese_crystal"},
308-
{"", "group:wood", ""},
309-
}
310-
})
311-
312303
minetest.register_craft({
313304
output = "default:obsidian",
314305
recipe = {

mods/default/functions.lua

+45
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,51 @@ function default.register_fence_rail(name, def)
421421
minetest.register_node(name, def)
422422
end
423423

424+
--
425+
-- Mese post registration helper
426+
--
427+
428+
function default.register_mesepost(name, def)
429+
minetest.register_craft({
430+
output = name .. " 4",
431+
recipe = {
432+
{'', 'default:glass', ''},
433+
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
434+
{' ', def.material, ''},
435+
}
436+
})
437+
438+
local post_texture = def.texture .. "^default_mese_post_light_side.png^[makealpha:0,0,0"
439+
local post_texture_dark = def.texture .. "^default_mese_post_light_side_dark.png^[makealpha:0,0,0"
440+
-- Allow almost everything to be overridden
441+
local default_fields = {
442+
wield_image = post_texture,
443+
drawtype = "nodebox",
444+
node_box = {
445+
type = "fixed",
446+
fixed = {
447+
{-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
448+
},
449+
},
450+
paramtype = "light",
451+
tiles = {def.texture, def.texture, post_texture_dark, post_texture_dark, post_texture, post_texture},
452+
light_source = default.LIGHT_MAX,
453+
sunlight_propagates = true,
454+
is_ground_content = false,
455+
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
456+
sounds = default.node_sound_wood_defaults(),
457+
}
458+
for k, v in pairs(default_fields) do
459+
if def[k] == nil then
460+
def[k] = v
461+
end
462+
end
463+
464+
def.texture = nil
465+
def.material = nil
466+
467+
minetest.register_node(name, def)
468+
end
424469

425470
--
426471
-- Leafdecay

mods/default/nodes.lua

+32-19
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ default:brick
221221
222222
default:meselamp
223223
default:mese_post_light
224+
default:mese_post_light_acacia_wood
225+
default:mese_post_light_junglewood
226+
default:mese_post_light_pine_wood
227+
default:mese_post_light_aspen_wood
224228
225229
Misc
226230
----
@@ -2836,25 +2840,34 @@ minetest.register_node("default:meselamp", {
28362840
light_source = default.LIGHT_MAX,
28372841
})
28382842

2839-
minetest.register_node("default:mese_post_light", {
2840-
description = S("Mese Post Light"),
2841-
tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2842-
"default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2843-
"default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2844-
wield_image = "default_mese_post_light_side.png",
2845-
drawtype = "nodebox",
2846-
node_box = {
2847-
type = "fixed",
2848-
fixed = {
2849-
{-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2850-
},
2851-
},
2852-
paramtype = "light",
2853-
light_source = default.LIGHT_MAX,
2854-
sunlight_propagates = true,
2855-
is_ground_content = false,
2856-
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2857-
sounds = default.node_sound_wood_defaults(),
2843+
default.register_mesepost("default:mese_post_light", {
2844+
description = S("Apple Wood Mese Post Light"),
2845+
texture = "default_fence_wood.png",
2846+
material = "default:wood",
2847+
})
2848+
2849+
default.register_mesepost("default:mese_post_light_acacia", {
2850+
description = S("Acacia Wood Mese Post Light"),
2851+
texture = "default_fence_acacia_wood.png",
2852+
material = "default:acacia_wood",
2853+
})
2854+
2855+
default.register_mesepost("default:mese_post_light_junglewood", {
2856+
description = S("Jungle Wood Mese Post Light"),
2857+
texture = "default_fence_junglewood.png",
2858+
material = "default:junglewood",
2859+
})
2860+
2861+
default.register_mesepost("default:mese_post_light_pine_wood", {
2862+
description = S("Pine Wood Mese Post Light"),
2863+
texture = "default_fence_pine_wood.png",
2864+
material = "default:pine_wood",
2865+
})
2866+
2867+
default.register_mesepost("default:mese_post_light_aspen_wood", {
2868+
description = S("Aspen Wood Mese Post Light"),
2869+
texture = "default_fence_aspen_wood.png",
2870+
material = "default:aspen_wood",
28582871
})
28592872

28602873
--
Loading
Loading
Binary file not shown.

0 commit comments

Comments
 (0)