1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2024-11-13 22:10:19 +01:00

Merge branch 'fences' into 'master'

add optional fences and gates

See merge request VanessaE/moretrees!2
This commit is contained in:
Vanessa Dannenberg 2019-10-03 18:13:57 +00:00
commit 6fd3729669
2 changed files with 41 additions and 2 deletions

View File

@ -25,12 +25,16 @@ moretrees.enable_beech = false
moretrees.spawn_saplings = true
-- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is
-- installed, this will use that mod's Stairs Plus component. Otherwise, it
-- installed, this will use that mod's Stairs Plus component. Otherwise, it
-- will use the default stairs mod in minetest_game, if present
moretrees.enable_stairs = true
-- Set this to true if you want the plantlike drawtype for leaves, which
-- If this variable is set to true, register fences for moretrees wood
moretrees.enable_fences = false
-- Set this to true if you want the plantlike drawtype for leaves, which
-- improves some peoples' framerates without resorting to making leaf nodes opaque.
-- Affects default leaves and default jungle leaves also.

View File

@ -209,6 +209,41 @@ for i in ipairs(moretrees.treelist) do
end
end
if moretrees.enable_fences then
local planks_name = "moretrees:" .. treename .. "_planks"
local planks_tile = "moretrees_" .. treename .. "_wood.png"
default.register_fence("moretrees:" .. treename .. "_fence", {
description = S(treedesc.." Fence"),
texture = planks_tile,
inventory_image = "default_fence_overlay.png^" .. planks_tile ..
"^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^" .. planks_tile ..
"^default_fence_overlay.png^[makealpha:255,126,126",
material = planks_name,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
})
default.register_fence_rail("moretrees:" .. treename .. "_fence_rail", {
description = S(treedesc.." Fence Rail"),
texture = planks_tile,
inventory_image = "default_fence_rail_overlay.png^" .. planks_tile ..
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_rail_overlay.png^" .. planks_tile ..
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
material = planks_name,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
})
if minetest.global_exists("doors") then
doors.register_fencegate("moretrees:" .. treename .. "_gate", {
description = S(treedesc .. " Fence Gate"),
texture = planks_tile,
material = planks_name,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}
})
end
end
end
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {