Extra error checking.
This commit is contained in:
parent
aa999e2ed5
commit
bf26b8bee1
25 changed files with 897 additions and 314 deletions
122
cloudgen.lua
122
cloudgen.lua
|
@ -1,4 +1,117 @@
|
|||
dofile(fun_caves.path .. "/deco_clouds.lua")
|
||||
|
||||
local newnode = fun_caves.clone_node("default:dirt")
|
||||
newnode.description = "Cloud"
|
||||
newnode.tiles = {'fun_caves_cloud.png'}
|
||||
newnode.sunlight_propagates = true
|
||||
minetest.register_node("fun_caves:cloud", newnode)
|
||||
|
||||
newnode = fun_caves.clone_node("default:dirt")
|
||||
newnode.description = "Storm Cloud"
|
||||
newnode.tiles = {'fun_caves_storm_cloud.png'}
|
||||
--newnode.sunlight_propagates = true
|
||||
minetest.register_node("fun_caves:storm_cloud", newnode)
|
||||
|
||||
minetest.register_node("fun_caves:wispy_cloud", {
|
||||
description = "Wispy Cloud",
|
||||
tiles = {'fun_caves_wisp.png'},
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
paramtype = 'light',
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:moon_weed", {
|
||||
description = "Moon Weed",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"fun_caves_moon_weed.png"},
|
||||
inventory_image = "fun_caves_moon_weed.png",
|
||||
waving = false,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
light_source = 8,
|
||||
walkable = false,
|
||||
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:leaves_lumin", {
|
||||
description = "Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_leaves.png^[colorize:#FFDF00:150"},
|
||||
special_tiles = {"default_leaves_simple.png^[colorize:#FFDF00:150"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
light_source = 8,
|
||||
groups = {snappy = 3, leafdecay = 4, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
--{
|
||||
-- -- player will get sapling with 1/20 chance
|
||||
-- items = {'default:sapling'},
|
||||
-- rarity = 20,
|
||||
--},
|
||||
{
|
||||
-- player will get leaves only if he get no saplings,
|
||||
-- this is because max_items is 1
|
||||
items = {'fun_caves:leaves_lumin'},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:lumin_tree", {
|
||||
description = "Lumin Tree",
|
||||
tiles = {
|
||||
"default_tree_top.png", "default_tree_top.png", "fun_caves_lumin_tree.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = { {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, }
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {tree = 1, choppy = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
newnode = fun_caves.clone_node("default:stone_with_iron")
|
||||
newnode.description = "Silver Lining"
|
||||
newnode.tiles = {'fun_caves_cloud.png^default_mineral_coal.png^[colorize:#FFFFFF:175'}
|
||||
newnode.drop = "fun_caves:silver_lump"
|
||||
minetest.register_node("fun_caves:silver_lining", newnode)
|
||||
|
||||
minetest.register_craftitem("fun_caves:silver_lump", {
|
||||
description = "Lump of Silver",
|
||||
inventory_image = 'default_coal_lump.png^[colorize:#FFFFFF:175',
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:silver_ingot", {
|
||||
description = "Silver Ingot",
|
||||
inventory_image = 'default_steel_ingot.png^[colorize:#FFFFFF:175',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "fun_caves:silver_ingot",
|
||||
recipe = "fun_caves:silver_lump",
|
||||
})
|
||||
|
||||
|
||||
local max_depth = 31000
|
||||
|
@ -10,6 +123,10 @@ local plant_noise = {offset = 0.0, scale = 1.0, spread = {x = 200, y = 200, z =
|
|||
local biome_noise = {offset = 0.0, scale = 1.0, spread = {x = 400, y = 400, z = 400}, seed = -1471, octaves = 3, persist = 0.5, lacunarity = 2.0}
|
||||
|
||||
fun_caves.cloudgen = function(minp, maxp, data, p2data, area, node)
|
||||
if not (minp and maxp and data and p2data and area and node and type(data) == 'table' and type(p2data) == 'table') then
|
||||
return
|
||||
end
|
||||
|
||||
if minp.y ~= 4368 then
|
||||
return
|
||||
end
|
||||
|
@ -22,6 +139,9 @@ fun_caves.cloudgen = function(minp, maxp, data, p2data, area, node)
|
|||
local cloud_2 = minetest.get_perlin_map(cloud_noise_2, map_max):get3dMap_flat(map_min)
|
||||
local plant_n = minetest.get_perlin_map(plant_noise, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
|
||||
local biome_n = minetest.get_perlin_map(biome_noise, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
|
||||
if not (cloud_1 and cloud_2 and plant_n and biome_n) then
|
||||
return
|
||||
end
|
||||
|
||||
local write = false
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue