Skip to content

Commit ab49405

Browse files
kakalak-lumberJackSmallJoker
authored andcommittedJul 26, 2018
wall.register: Allow table as texture value
1 parent 506eca2 commit ab49405

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎mods/walls/init.lua

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
walls = {}
22

3-
walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds)
3+
walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wall_sounds)
4+
--make wall_texture_table paramenter backwards compatible for mods passing single texture
5+
if type(wall_texture_table) ~= "table" then
6+
wall_texture_table = { wall_texture_table }
7+
end
48
-- inventory node, and pole-type wall start item
59
minetest.register_node(wall_name, {
610
description = wall_desc,
@@ -17,7 +21,7 @@ walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sou
1721
connects_to = { "group:wall", "group:stone", "group:fence" },
1822
paramtype = "light",
1923
is_ground_content = false,
20-
tiles = { wall_texture, },
24+
tiles = wall_texture_table,
2125
walkable = true,
2226
groups = { cracky = 3, wall = 1, stone = 2 },
2327
sounds = wall_sounds,
@@ -35,12 +39,12 @@ walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sou
3539

3640
end
3741

38-
walls.register("walls:cobble", "Cobblestone Wall", "default_cobble.png",
42+
walls.register("walls:cobble", "Cobblestone Wall", {"default_cobble.png"},
3943
"default:cobble", default.node_sound_stone_defaults())
4044

41-
walls.register("walls:mossycobble", "Mossy Cobblestone Wall", "default_mossycobble.png",
45+
walls.register("walls:mossycobble", "Mossy Cobblestone Wall", {"default_mossycobble.png"},
4246
"default:mossycobble", default.node_sound_stone_defaults())
4347

44-
walls.register("walls:desertcobble", "Desert Cobblestone Wall", "default_desert_cobble.png",
48+
walls.register("walls:desertcobble", "Desert Cobblestone Wall", {"default_desert_cobble.png"},
4549
"default:desert_cobble", default.node_sound_stone_defaults())
4650

0 commit comments

Comments
 (0)