industrialtest/mapgen.lua

59 lines
1.5 KiB
Lua
Raw Normal View History

-- IndustrialTest
-- Copyright (C) 2023 mrkubax10
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local definition={
name="industrialtest:rubber_tree",
deco_type="schematic",
sidelen=16,
noise_params={
offset=0.024,
scale=0.015,
spread={x=250,y=250,z=250},
seed=2,
octaves=3,
persist=0.66
},
schematic={
size=vector.new(1,1,1),
data={
{
name="industrialtest:rubber_sapling",
param2=1
}
}
},
flags="place_center_x, place_center_z"
}
if industrialtest.mtgAvailable then
definition.place_on={"default:dirt_with_grass"}
definition.biomes={"deciduous_forest"}
definition.y_max=31000
definition.y_min=1
end
minetest.register_decoration(definition)
minetest.register_lbm({
label="Make rubber trees",
name="industrialtest:make_rubber_trees",
nodenames={"industrialtest:rubber_sapling"},
run_at_every_load=false,
action=function(pos)
local node=minetest.get_node(pos)
if node.param2==1 then
industrialtest.makeRubberTree(pos)
end
end
})