mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-26 01:50:25 +01:00
fix a few minor bugs
This commit is contained in:
parent
ff1d5d0af2
commit
9e53ee9836
@ -98,7 +98,7 @@ local spore_tree_cavern_floor = function(abs_cracks, vert_rand, vi, area, data,
|
||||
if math.random() < 0.1 then
|
||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, spore_tree_shrublist)
|
||||
elseif math.random() < 0.05 then
|
||||
df_trees.spawn_spore_tree_vm(vi+ystride, area, data)
|
||||
df_trees.spawn_spore_tree_vm(vi+ystride, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -131,7 +131,7 @@ local fungispore_cavern_floor = function(abs_cracks, vert_rand, vi, area, data,
|
||||
if math.random() < 0.025 then
|
||||
df_trees.spawn_fungiwood_vm(vi+ystride, area, data)
|
||||
elseif math.random() < 0.025 then
|
||||
df_trees.spawn_spore_tree_vm(vi+ystride, area, data)
|
||||
df_trees.spawn_spore_tree_vm(vi+ystride, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -57,11 +57,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
df_caverns.tunnel_ceiling(minp, maxp, area, vi, nvals_cracks, data, data_param2, humidity > 30)
|
||||
end
|
||||
previous_potential_floor_vi = nil
|
||||
previous_potential_floor_in_range = nil
|
||||
elseif not mapgen_helper.buildable_to(current_node) then
|
||||
-- we've entered a non-stone ceiling of some kind. Abort potential floor-ceiling pair detection.
|
||||
previous_potential_floor_vi = nil
|
||||
previous_potential_floor_in_range = nil
|
||||
end
|
||||
end
|
||||
previous_node = current_node
|
||||
|
@ -272,6 +272,10 @@ minetest.register_node("df_primordial_items:fern_sapling", {
|
||||
wield_image = "dfcaverns_jungle_fern_03.png",
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 13},
|
||||
_dfcaverns_dead_node = "default:dry_shrub",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
buildable_to = true,
|
||||
|
@ -95,6 +95,10 @@ minetest.register_node("df_primordial_items:jungle_mushroom_sapling", {
|
||||
inventory_image = "dfcaverns_jungle_mushroom_02.png^[brighten",
|
||||
wield_image = "dfcaverns_jungle_mushroom_02.png^[brighten",
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, light_sensitive_fungus = 13},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
buildable_to = true,
|
||||
|
@ -226,6 +226,10 @@ minetest.register_node("df_primordial_items:jungletree_sapling", {
|
||||
wield_image = "dfcaverns_jungle_sapling.png",
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 13},
|
||||
_dfcaverns_dead_node = "default:dry_shrub",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
buildable_to = true,
|
||||
|
@ -692,6 +692,10 @@ minetest.register_node("df_primordial_items:mush_sapling", {
|
||||
inventory_image = "dfcaverns_mush_sapling.png",
|
||||
wield_image = "dfcaverns_mush_sapling.png",
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 11},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
buildable_to = true,
|
||||
@ -715,7 +719,7 @@ minetest.register_node("df_primordial_items:mush_sapling", {
|
||||
if df_farming and df_farming.kill_if_sunlit(pos) then
|
||||
return
|
||||
end
|
||||
local mushroom = df_primordial.get_primordial_mushroom()
|
||||
local mushroom = df_primordial_items.get_primordial_mushroom()
|
||||
local rotation = (math.random(1,4)-1)*90
|
||||
minetest.set_node(pos, {name="air"}) -- clear sapling so mushroom can replace it
|
||||
mapgen_helper.place_schematic(pos, mushroom, rotation)
|
||||
|
@ -194,7 +194,7 @@ local c_spore_pod = minetest.get_content_id("df_trees:spore_tree_fruiting_body")
|
||||
local c_tree = minetest.get_content_id("df_trees:spore_tree")
|
||||
local c_spore_frond = minetest.get_content_id("df_trees:spore_tree_hyphae")
|
||||
|
||||
df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has_fruiting_bodies)
|
||||
df_trees.spawn_spore_tree_vm = function(vi, area, data, data_param2, height, size, iters, has_fruiting_bodies)
|
||||
if height == nil then height = math.random(3,6) end
|
||||
if size == nil then size = 2 end
|
||||
if iters == nil then iters = 10 end
|
||||
@ -211,6 +211,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has
|
||||
local node_id = data[vi]
|
||||
if node_id == c_air or node_id == c_ignore or node_id == c_spore_frond or node_id == c_spore_pod then
|
||||
data[vi] = c_tree
|
||||
data_param2[vi] = 0
|
||||
end
|
||||
end
|
||||
|
||||
@ -225,6 +226,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has
|
||||
else
|
||||
data[vi] = c_spore_frond
|
||||
end
|
||||
data_param2[vi] = 0
|
||||
end
|
||||
vi = vi + 1
|
||||
end
|
||||
@ -247,6 +249,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has
|
||||
else
|
||||
data[vi] = c_spore_frond
|
||||
end
|
||||
data_param2[vi] = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -265,10 +268,12 @@ df_trees.spawn_spore_tree = function(pos)
|
||||
)
|
||||
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||
local data = vm:get_data()
|
||||
local data_param_2 = vm:get_param2_data()
|
||||
|
||||
df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data)
|
||||
df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data, data_param_2)
|
||||
|
||||
vm:set_data(data)
|
||||
vm:set_param2_data(data_param_2)
|
||||
vm:write_to_map()
|
||||
vm:update_map()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user