connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
},
- connects_to = {"group:fence", "group:wood", "group:tree"},
+ connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"},
inventory_image = fence_texture,
wield_image = fence_texture,
tiles = {def.texture},
end
+--
+-- Fence rail registration helper
+--
+
+function default.register_fence_rail(name, def)
+ minetest.register_craft({
+ output = name .. " 16",
+ recipe = {
+ { def.material, def.material },
+ { "", ""},
+ { def.material, def.material },
+ }
+ })
+
+ local fence_rail_texture = "default_fence_rail_overlay.png^" .. def.texture ..
+ "^default_fence_rail_overlay.png^[makealpha:255,126,126"
+ -- Allow almost everything to be overridden
+ local default_fields = {
+ paramtype = "light",
+ drawtype = "nodebox",
+ node_box = {
+ type = "connected",
+ fixed = {
+ {-1/16, 3/16, -1/16, 1/16, 5/16, 1/16},
+ {-1/16, -3/16, -1/16, 1/16, -5/16, 1/16}
+ },
+ -- connect_top =
+ -- connect_bottom =
+ connect_front = {
+ {-1/16, 3/16, -1/2, 1/16, 5/16, -1/16},
+ {-1/16, -5/16, -1/2, 1/16, -3/16, -1/16}},
+ connect_left = {
+ {-1/2, 3/16, -1/16, -1/16, 5/16, 1/16},
+ {-1/2, -5/16, -1/16, -1/16, -3/16, 1/16}},
+ connect_back = {
+ {-1/16, 3/16, 1/16, 1/16, 5/16, 1/2},
+ {-1/16, -5/16, 1/16, 1/16, -3/16, 1/2}},
+ connect_right = {
+ {1/16, 3/16, -1/16, 1/2, 5/16, 1/16},
+ {1/16, -5/16, -1/16, 1/2, -3/16, 1/16}},
+ },
+ connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"},
+ inventory_image = fence_rail_texture,
+ wield_image = fence_rail_texture,
+ tiles = {def.texture},
+ sunlight_propagates = true,
+ is_ground_content = false,
+ groups = {},
+ }
+ for k, v in pairs(default_fields) do
+ if def[k] == nil then
+ def[k] = v
+ end
+ end
+
+ -- Always add to the fence group, even if no group provided
+ def.groups.fence = 1
+
+ def.texture = nil
+ def.material = nil
+
+ minetest.register_node(name, def)
+end
+
+
--
-- Leafdecay
--
default.register_fence("default:fence_wood", {
description = "Apple Wood Fence",
texture = "default_fence_wood.png",
- inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
- wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
+ inventory_image = "default_fence_overlay.png^default_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_overlay.png^default_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
material = "default:wood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
default.register_fence("default:fence_acacia_wood", {
description = "Acacia Wood Fence",
texture = "default_fence_acacia_wood.png",
- inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
- wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
+ inventory_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
material = "default:acacia_wood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
default.register_fence("default:fence_junglewood", {
description = "Jungle Wood Fence",
texture = "default_fence_junglewood.png",
- inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
- wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
+ inventory_image = "default_fence_overlay.png^default_junglewood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_overlay.png^default_junglewood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
material = "default:junglewood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
default.register_fence("default:fence_pine_wood", {
description = "Pine Wood Fence",
texture = "default_fence_pine_wood.png",
- inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
- wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
+ inventory_image = "default_fence_overlay.png^default_pine_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_overlay.png^default_pine_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
material = "default:pine_wood",
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults()
default.register_fence("default:fence_aspen_wood", {
description = "Aspen Wood Fence",
texture = "default_fence_aspen_wood.png",
- inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
- wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
+ inventory_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
+ "default_fence_overlay.png^[makealpha:255,126,126",
material = "default:aspen_wood",
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults()
})
+default.register_fence_rail("default:fence_rail_wood", {
+ description = "Apple Wood Fence Rail",
+ texture = "default_wood.png",
+ inventory_image = "default_fence_rail_overlay.png^default_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_rail_overlay.png^default_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ material = "default:wood",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
+ sounds = default.node_sound_wood_defaults()
+})
+
+default.register_fence_rail("default:fence_rail_acacia_wood", {
+ description = "Acacia Wood Fence Rail",
+ texture = "default_acacia_wood.png",
+ inventory_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ material = "default:acacia_wood",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
+ sounds = default.node_sound_wood_defaults()
+})
+
+default.register_fence_rail("default:fence_rail_junglewood", {
+ description = "Jungle Wood Fence Rail",
+ texture = "default_junglewood.png",
+ inventory_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ material = "default:junglewood",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
+ sounds = default.node_sound_wood_defaults()
+})
+
+default.register_fence_rail("default:fence_rail_pine_wood", {
+ description = "Pine Wood Fence Rail",
+ texture = "default_pine_wood.png",
+ inventory_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ material = "default:pine_wood",
+ groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
+ sounds = default.node_sound_wood_defaults()
+})
+
+default.register_fence_rail("default:fence_rail_aspen_wood", {
+ description = "Aspen Wood Fence Rail",
+ texture = "default_aspen_wood.png",
+ inventory_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ wield_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
+ "default_fence_rail_overlay.png^[makealpha:255,126,126",
+ material = "default:aspen_wood",
+ groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2},
+ sounds = default.node_sound_wood_defaults()
+})
+
minetest.register_node("default:glass", {
description = "Glass",
drawtype = "glasslike_framed_optional",