forked from mtcontrib/moretrees
Merge branch 'master' of yunohost.local:mtcontrib/moretrees into nalc-1.2-dev
This commit is contained in:
commit
114e47966b
@ -30,6 +30,10 @@ moretrees.spawn_saplings = true
|
|||||||
|
|
||||||
moretrees.enable_stairs = true
|
moretrees.enable_stairs = true
|
||||||
|
|
||||||
|
-- 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
|
-- Set this to true if you want the plantlike drawtype for leaves, which
|
||||||
-- improves some peoples' framerates without resorting to making leaf nodes opaque.
|
-- improves some peoples' framerates without resorting to making leaf nodes opaque.
|
||||||
-- Affects default leaves and default jungle leaves also.
|
-- Affects default leaves and default jungle leaves also.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
default
|
default
|
||||||
biome_lib
|
biome_lib
|
||||||
vessels
|
vessels
|
||||||
|
doors?
|
||||||
stairs?
|
stairs?
|
||||||
moreblocks?
|
moreblocks?
|
||||||
intllib?
|
intllib?
|
||||||
|
46
init.lua
46
init.lua
@ -15,6 +15,41 @@
|
|||||||
|
|
||||||
moretrees = {}
|
moretrees = {}
|
||||||
|
|
||||||
|
minetest.override_item("default:sapling", {
|
||||||
|
description = "Sapling"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("default:tree", {
|
||||||
|
description = "Tree"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("default:wood", {
|
||||||
|
description = "Wooden Planks"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("default:leaves", {
|
||||||
|
description = "Leaves"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("default:fence_wood", {
|
||||||
|
description = "Wooden Fence"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("default:fence_rail_wood", {
|
||||||
|
description = "Wooden Fence Rail"
|
||||||
|
})
|
||||||
|
|
||||||
|
if minetest.get_modpath("doors") then
|
||||||
|
minetest.override_item("doors:gate_wood_closed", {
|
||||||
|
description = "Wooden Fence Gate"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.override_item("doors:gate_wood_open", {
|
||||||
|
description = "Wooden Fence Gate"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Read the default config file (and if necessary, copy it to the world folder).
|
-- Read the default config file (and if necessary, copy it to the world folder).
|
||||||
|
|
||||||
local worldpath=minetest.get_worldpath()
|
local worldpath=minetest.get_worldpath()
|
||||||
@ -36,17 +71,6 @@ else
|
|||||||
end
|
end
|
||||||
moretrees.intllib = S
|
moretrees.intllib = S
|
||||||
|
|
||||||
-- clone node
|
|
||||||
|
|
||||||
function moretrees.clone_node(name)
|
|
||||||
local node2 = {}
|
|
||||||
local node = minetest.registered_nodes[name]
|
|
||||||
for k,v in pairs(node) do
|
|
||||||
node2[k]=v
|
|
||||||
end
|
|
||||||
return node2
|
|
||||||
end
|
|
||||||
|
|
||||||
-- infinite stacks checking
|
-- infinite stacks checking
|
||||||
|
|
||||||
if minetest.get_modpath("unified_inventory") or not
|
if minetest.get_modpath("unified_inventory") or not
|
||||||
|
@ -209,6 +209,41 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
|
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
||||||
@ -406,7 +441,7 @@ default.register_leafdecay({
|
|||||||
|
|
||||||
|
|
||||||
if moretrees.enable_redefine_apple then
|
if moretrees.enable_redefine_apple then
|
||||||
local appledef = moretrees.clone_node("default:apple")
|
local appledef = table.copy(minetest.registered_nodes["default:apple"])
|
||||||
appledef.groups.attached_node = 1
|
appledef.groups.attached_node = 1
|
||||||
minetest.register_node(":default:apple", appledef)
|
minetest.register_node(":default:apple", appledef)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user