mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
parent
0818c7996f
commit
57aad89094
@ -14,13 +14,13 @@ moretrees.enable_birch = true
|
||||
moretrees.enable_spruce = true
|
||||
moretrees.enable_jungle_tree = true
|
||||
moretrees.enable_fir = true
|
||||
moretrees.enable_beech = true
|
||||
moretrees.enable_beech = false
|
||||
|
||||
-- set this to true to make moretrees spawn saplings at mapgen time instead
|
||||
-- of fully-grown trees, which will grow into full trees very quickly. With
|
||||
-- older versions of biome_lib, doing this will reduce mapgen lag.
|
||||
-- of fully-grown trees, which will grow into full trees after a very short
|
||||
-- delay. This reduces mapgen lag in some situations.
|
||||
|
||||
moretrees.spawn_saplings = true
|
||||
moretrees.spawn_saplings = false
|
||||
|
||||
-- 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
|
||||
@ -34,26 +34,21 @@ moretrees.enable_stairs = true
|
||||
|
||||
moretrees.plantlike_leaves = false
|
||||
|
||||
-- Set this to true to enable leaf decay of all trees except the default ones.
|
||||
|
||||
moretrees.enable_leafdecay = true
|
||||
|
||||
-- Enable this if you want moretrees to redefine default apples so that they
|
||||
-- fall when leaves decay/are dug.
|
||||
|
||||
moretrees.enable_redefine_apple = true
|
||||
|
||||
-- various settings to configure default and default-jungle leaf decay.
|
||||
-- Set this to true to enable leaf decay of all trees except the default ones.
|
||||
|
||||
moretrees.enable_leafdecay = true
|
||||
|
||||
-- various related settings to configure leaf decay.
|
||||
|
||||
moretrees.leafdecay_delay = 2
|
||||
moretrees.leafdecay_chance = 100
|
||||
moretrees.leafdecay_chance = 5
|
||||
moretrees.leafdecay_radius = 5
|
||||
|
||||
moretrees.palm_leafdecay_radius = 15
|
||||
|
||||
moretrees.default_leafdecay_delay = 3
|
||||
moretrees.default_leafdecay_chance = 50
|
||||
moretrees.default_leafdecay_radius = 4
|
||||
moretrees.palm_leafdecay_radius = 10
|
||||
|
||||
-- Change these settings if you want default trees to be gradually cut down
|
||||
-- above the elevation where firs normally generate.
|
||||
|
@ -24,21 +24,8 @@ local modpath=minetest.get_modpath("moretrees")
|
||||
|
||||
dofile(modpath.."/default_settings.txt")
|
||||
|
||||
if io.open(worldpath.."/moretrees_settings.txt","r") == nil then
|
||||
|
||||
io.input(modpath.."/default_settings.txt")
|
||||
io.output(worldpath.."/moretrees_settings.txt")
|
||||
|
||||
local size = 2^13 -- good buffer size (8K)
|
||||
while true do
|
||||
local block = io.read(size)
|
||||
if not block then
|
||||
if io.open(worldpath.."/moretrees_settings.txt","r") then
|
||||
io.close()
|
||||
break
|
||||
end
|
||||
io.write(block)
|
||||
end
|
||||
else
|
||||
dofile(worldpath.."/moretrees_settings.txt")
|
||||
end
|
||||
|
||||
@ -90,7 +77,6 @@ dofile(modpath.."/node_defs.lua")
|
||||
dofile(modpath.."/biome_defs.lua")
|
||||
dofile(modpath.."/saplings.lua")
|
||||
dofile(modpath.."/crafts.lua")
|
||||
dofile(modpath.."/leafdecay.lua")
|
||||
|
||||
-- tree spawning setup
|
||||
|
||||
|
@ -1,87 +0,0 @@
|
||||
-- leaf decay
|
||||
|
||||
-- this function is based on the default leafdecay code
|
||||
local process_drops = function(pos, name)
|
||||
local drops = minetest.get_node_drops(name)
|
||||
for _,dropitem in ipairs(drops) do
|
||||
if dropitem ~= name
|
||||
or (string.find(name, "leaves") and moretrees.decay_leaves_as_items) then
|
||||
local newpos = {
|
||||
x=pos.x + math.random() - 0.5,
|
||||
y=pos.y + math.random() - 0.5,
|
||||
z=pos.z + math.random() - 0.5
|
||||
}
|
||||
minetest.add_item(newpos, dropitem)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if moretrees.enable_leafdecay then
|
||||
for i in ipairs(moretrees.treelist) do
|
||||
local treename = moretrees.treelist[i][1]
|
||||
if treename ~= "jungletree" and treename ~= "pine" and treename ~= "acacia" and treename ~= "fir" and treename ~= "palm" then
|
||||
minetest.register_abm({
|
||||
nodenames = "moretrees:"..treename.."_leaves",
|
||||
interval = moretrees.leafdecay_delay,
|
||||
chance = moretrees.leafdecay_chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:"..treename.."_trunk" }) then return end
|
||||
process_drops(pos, node.name)
|
||||
minetest.remove_node(pos)
|
||||
nodeupdate(pos)
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:jungleleaves", "moretrees:jungletree_leaves_red", "moretrees:jungletree_leaves_yellow"},
|
||||
interval = moretrees.leafdecay_delay,
|
||||
chance = moretrees.leafdecay_chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if minetest.find_node_near(pos, moretrees.leafdecay_radius, {"ignore", "default:jungletree"}) then return end
|
||||
process_drops(pos, node.name)
|
||||
minetest.remove_node(pos)
|
||||
nodeupdate(pos)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"moretrees:fir_leaves", "moretrees:fir_leaves_bright"},
|
||||
interval = moretrees.leafdecay_delay,
|
||||
chance = moretrees.leafdecay_chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:fir_trunk" }) then return end
|
||||
process_drops(pos, node.name)
|
||||
minetest.remove_node(pos)
|
||||
nodeupdate(pos)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = "moretrees:palm_leaves",
|
||||
interval = moretrees.leafdecay_delay,
|
||||
chance = moretrees.leafdecay_chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if minetest.find_node_near(pos, moretrees.palm_leafdecay_radius, { "ignore", "moretrees:palm_trunk" }) then return end
|
||||
process_drops(pos, node.name)
|
||||
minetest.remove_node(pos)
|
||||
nodeupdate(pos)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-- Decay apple tree blossoms from nature_classic mod
|
||||
if minetest.get_modpath("nature_classic") then
|
||||
minetest.register_abm({
|
||||
nodenames = "moretrees:apple_blossoms",
|
||||
interval = moretrees.default_leafdecay_delay,
|
||||
chance = moretrees.default_leafdecay_chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:apple_tree_trunk" }) then return end
|
||||
process_drops(pos, "moretrees:apple_tree_leaves")
|
||||
minetest.remove_node(pos)
|
||||
nodeupdate(pos)
|
||||
end
|
||||
})
|
||||
end
|
@ -33,11 +33,6 @@ end
|
||||
|
||||
-- redefine default leaves to handle plantlike and/or leaf decay options
|
||||
|
||||
if moretrees.enable_default_leafdecay then
|
||||
minetest.override_item("default:leaves", {
|
||||
groups = { snappy = 3, flammable = 2, leaves = 1 }
|
||||
})
|
||||
end
|
||||
if moretrees.plantlike_leaves then
|
||||
minetest.override_item("default:leaves", {
|
||||
inventory_image = minetest.inventorycube("default_leaves.png"),
|
||||
@ -52,11 +47,6 @@ end
|
||||
|
||||
-- redefine default jungle leaves for same
|
||||
|
||||
if moretrees.enable_default_leafdecay then
|
||||
minetest.override_item("default:jungleleaves", {
|
||||
groups = { snappy = 3, flammable = 2, leaves = 1 }
|
||||
})
|
||||
end
|
||||
if moretrees.plantlike_leaves then
|
||||
minetest.override_item("default:jungleleaves", {
|
||||
inventory_image = minetest.inventorycube("default_jungleleaves.png"),
|
||||
@ -76,12 +66,15 @@ for i in ipairs(moretrees.treelist) do
|
||||
local fruitdesc = moretrees.treelist[i][4]
|
||||
local selbox = moretrees.treelist[i][5]
|
||||
local vscale = moretrees.treelist[i][6]
|
||||
local saptext = moretrees.treelist[i][7] or "moretrees_"..treename.."_sapling.png"
|
||||
|
||||
local saptex = moretrees.treelist[i][7]
|
||||
|
||||
if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes.
|
||||
and treename ~= "acacia"
|
||||
and treename ~= "pine" then
|
||||
|
||||
saptex = "moretrees_"..treename.."_sapling.png"
|
||||
|
||||
minetest.register_node("moretrees:"..treename.."_trunk", {
|
||||
description = S(treedesc.." Trunk"),
|
||||
tiles = {
|
||||
@ -107,8 +100,8 @@ for i in ipairs(moretrees.treelist) do
|
||||
minetest.register_node("moretrees:"..treename.."_sapling", {
|
||||
description = S(treedesc.." Sapling"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {saptext},
|
||||
inventory_image = saptext,
|
||||
tiles = {saptex},
|
||||
inventory_image = saptex,
|
||||
paramtype = "light",
|
||||
paramtype2 = "waving",
|
||||
walkable = false,
|
||||
@ -125,9 +118,11 @@ for i in ipairs(moretrees.treelist) do
|
||||
-- this is because max_items is 1
|
||||
|
||||
local droprarity = 100
|
||||
local decay = moretrees.leafdecay_radius
|
||||
|
||||
if treename == "palm" then
|
||||
droprarity = 20
|
||||
decay = moretrees.palm_leafdecay_radius
|
||||
end
|
||||
|
||||
local moretrees_leaves_inventory_image = nil
|
||||
@ -147,7 +142,7 @@ for i in ipairs(moretrees.treelist) do
|
||||
tiles = { "moretrees_"..treename.."_leaves.png" },
|
||||
inventory_image = moretrees_leaves_inventory_image,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
|
||||
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = decay},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
drop = {
|
||||
@ -222,8 +217,8 @@ for i in ipairs(moretrees.treelist) do
|
||||
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
||||
description = S(treedesc.." Sapling"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {saptext},
|
||||
inventory_image = saptext,
|
||||
tiles = {saptex},
|
||||
inventory_image = saptex,
|
||||
paramtype = "light",
|
||||
paramtype2 = "waving",
|
||||
walkable = false,
|
||||
@ -298,7 +293,7 @@ for color = 1, #jungleleaves do
|
||||
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..".png"},
|
||||
inventory_image = moretrees_leaves_inventory_image,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
|
||||
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = moretrees.leafdecay_radius },
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
@ -326,7 +321,7 @@ minetest.register_node("moretrees:fir_leaves_bright", {
|
||||
tiles = { "moretrees_fir_leaves_bright.png" },
|
||||
inventory_image = moretrees_leaves_inventory_image,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1 },
|
||||
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = moretrees.leafdecay_radius },
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
|
@ -1,2 +1,3 @@
|
||||
default
|
||||
watershed?
|
||||
|
||||
|
@ -16,7 +16,7 @@ minetest.register_node(":"..nature.blossom_node, {
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = nature.blossom_textures,
|
||||
paramtype = "light",
|
||||
groups = { snappy = 3, leafdecay = 3, flammable = 2 },
|
||||
groups = { snappy = 3, leafdecay = 3, flammable = 2, leafdecay = 3 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
waving = 1
|
||||
})
|
||||
|
@ -103,7 +103,6 @@ biome_lib:register_generate_plant({
|
||||
"moretrees:jungletree_sapling_ongen",
|
||||
"moretrees:oak_sapling_ongen",
|
||||
"moretrees:palm_sapling_ongen",
|
||||
"moretrees:pine_sapling_ongen",
|
||||
"moretrees:rubber_tree_sapling_ongen",
|
||||
"moretrees:sequoia_sapling_ongen",
|
||||
"moretrees:spruce_sapling_ongen",
|
||||
|
Loading…
Reference in New Issue
Block a user