Add Malay translation
[oweals/minetest_game.git] / mods / walls / init.lua
1 -- walls/init.lua
2
3 walls = {}
4
5 local fence_collision_extra = minetest.settings:get_bool("enable_fence_tall") and 3/8 or 0
6
7 -- Load support for MT game translation.
8 local S = minetest.get_translator("walls")
9
10 walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wall_sounds)
11         --make wall_texture_table paramenter backwards compatible for mods passing single texture
12         if type(wall_texture_table) ~= "table" then
13                 wall_texture_table = { wall_texture_table }
14         end
15         -- inventory node, and pole-type wall start item
16         minetest.register_node(wall_name, {
17                 description = wall_desc,
18                 drawtype = "nodebox",
19                 node_box = {
20                         type = "connected",
21                         fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
22                         -- connect_bottom =
23                         connect_front = {-3/16, -1/2, -1/2,  3/16, 3/8, -1/4},
24                         connect_left = {-1/2, -1/2, -3/16, -1/4, 3/8,  3/16},
25                         connect_back = {-3/16, -1/2,  1/4,  3/16, 3/8,  1/2},
26                         connect_right = { 1/4, -1/2, -3/16,  1/2, 3/8,  3/16},
27                 },
28                 collision_box = {
29                         type = "connected",
30                         fixed = {-1/4, -1/2, -1/4, 1/4, 1/2 + fence_collision_extra, 1/4},
31                         -- connect_top =
32                         -- connect_bottom =
33                         connect_front = {-1/4,-1/2,-1/2,1/4,1/2 + fence_collision_extra,-1/4},
34                         connect_left = {-1/2,-1/2,-1/4,-1/4,1/2 + fence_collision_extra,1/4},
35                         connect_back = {-1/4,-1/2,1/4,1/4,1/2 + fence_collision_extra,1/2},
36                         connect_right = {1/4,-1/2,-1/4,1/2,1/2 + fence_collision_extra,1/4},
37                 },
38                 connects_to = { "group:wall", "group:stone", "group:fence" },
39                 paramtype = "light",
40                 is_ground_content = false,
41                 tiles = wall_texture_table,
42                 walkable = true,
43                 groups = { cracky = 3, wall = 1, stone = 2 },
44                 sounds = wall_sounds,
45         })
46
47         -- crafting recipe
48         minetest.register_craft({
49                 output = wall_name .. " 6",
50                 recipe = {
51                         { "", "", "" },
52                         { wall_mat, wall_mat, wall_mat},
53                         { wall_mat, wall_mat, wall_mat},
54                 }
55         })
56
57 end
58
59 walls.register("walls:cobble", S("Cobblestone Wall"), {"default_cobble.png"},
60                 "default:cobble", default.node_sound_stone_defaults())
61
62 walls.register("walls:mossycobble", S("Mossy Cobblestone Wall"), {"default_mossycobble.png"},
63                 "default:mossycobble", default.node_sound_stone_defaults())
64
65 walls.register("walls:desertcobble", S("Desert Cobblestone Wall"), {"default_desert_cobble.png"},
66                 "default:desert_cobble", default.node_sound_stone_defaults())
67