mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-22 07:15:14 +02:00
Fix floating kelp with decoration gennotify fixup
This commit is contained in:
parent
14a60cdaee
commit
89a94c4da4
5 changed files with 61 additions and 2 deletions
mods
|
@ -53,6 +53,7 @@ mcl_ocean.kelp = kelp
|
|||
-- Once reach the maximum, kelp no longer grows.
|
||||
kelp.MIN_AGE = 0
|
||||
kelp.MAX_AGE = 25
|
||||
kelp.MAX_HEIGHT = 16
|
||||
|
||||
kelp.TICK = 0.2 -- Tick interval (in seconds) for updating kelp.
|
||||
|
||||
|
@ -372,6 +373,22 @@ local function detach_unsubmerged(pos)
|
|||
end
|
||||
end
|
||||
|
||||
function kelp.remove_kelp_below_structure(minp, maxp)
|
||||
local minp = vector.offset(minp, 0, -kelp.MAX_HEIGHT - 1, 0)
|
||||
local kelp_pos_list,_ = minetest.find_nodes_in_area(minp, maxp, {"group:kelp"})
|
||||
|
||||
for i = 1,#kelp_pos_list do
|
||||
local kelp_pos = kelp_pos_list[i]
|
||||
local kelp_node = minetest.get_node(kelp_pos)
|
||||
|
||||
minetest.swap_node(kelp_pos, {
|
||||
name = minetest.registered_nodes[kelp_node.name].node_dig_prediction,
|
||||
param = kelp_node.param,
|
||||
param2 = 0,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local function grow_kelp (pos)
|
||||
local node = mt_get_node(pos)
|
||||
local age = retrieve_age(pos)
|
||||
|
|
|
@ -3458,6 +3458,14 @@ local corals = {
|
|||
"fire"
|
||||
}
|
||||
|
||||
local function clear_kelp(t, minp, maxp, blockseed)
|
||||
for _,pos in pairs(t) do
|
||||
pos_minp = vector.offset(pos, -4, -4, -4)
|
||||
pos_maxp = vector.offset(pos, 4, 2, 4)
|
||||
mcl_ocean.kelp.remove_kelp_below_structure(pos_minp, pos_maxp)
|
||||
end
|
||||
end
|
||||
|
||||
local function register_coral_decos(ck)
|
||||
local c = corals[ck]
|
||||
local noise = {
|
||||
|
@ -3471,6 +3479,7 @@ local function register_coral_decos(ck)
|
|||
flags = "absvalue"
|
||||
}
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_deco_"..c.."_s1",
|
||||
deco_type = "schematic",
|
||||
place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"},
|
||||
sidelen = 80,
|
||||
|
@ -3481,8 +3490,10 @@ local function register_coral_decos(ck)
|
|||
schematic = mod_mcl_structures .. "/schematics/mcl_structures_coral_" .. c .. "_1.mts",
|
||||
rotation = "random",
|
||||
flags = "all_floors,force_placement",
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_deco_"..c.."_s2",
|
||||
deco_type = "schematic",
|
||||
place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"},
|
||||
noise_params = noise,
|
||||
|
@ -3493,9 +3504,11 @@ local function register_coral_decos(ck)
|
|||
schematic = mod_mcl_structures .. "/schematics/mcl_structures_coral_" .. c .. "_2.mts",
|
||||
rotation = "random",
|
||||
flags = "all_floors,force_placement",
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_deco_"..c.."_block",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:" .. c .. "_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3507,8 +3520,10 @@ local function register_coral_decos(ck)
|
|||
flags = "force_placement, all_floors",
|
||||
height = 1,
|
||||
height_max = 1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_deco_"..c.."_fan",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:horn_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3520,6 +3535,7 @@ local function register_coral_decos(ck)
|
|||
flags = "force_placement, all_floors",
|
||||
height = 1,
|
||||
height_max = 1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -3553,6 +3569,7 @@ local function register_decorations()
|
|||
register_coral_decos(k)
|
||||
end
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_dead_brain",
|
||||
deco_type = "simple",
|
||||
place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"},
|
||||
sidelen = 16,
|
||||
|
@ -3574,9 +3591,11 @@ local function register_decorations()
|
|||
height = 1,
|
||||
height_max = 1,
|
||||
place_offset_y = -1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_pickled_dead_brain_1",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:dead_brain_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3589,8 +3608,10 @@ local function register_decorations()
|
|||
height = 1,
|
||||
height_max = 1,
|
||||
place_offset_y = -1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_pickled_dead_brain_2",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:dead_brain_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3603,8 +3624,10 @@ local function register_decorations()
|
|||
height = 1,
|
||||
height_max = 1,
|
||||
place_offset_y = -1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_pickled_dead_brain_3",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:dead_brain_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3617,8 +3640,10 @@ local function register_decorations()
|
|||
height = 1,
|
||||
height_max = 1,
|
||||
place_offset_y = -1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_pickled_dead_brain_4",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_ocean:dead_brain_coral_block"},
|
||||
sidelen = 16,
|
||||
|
@ -3631,9 +3656,11 @@ local function register_decorations()
|
|||
height = 1,
|
||||
height_max = 1,
|
||||
place_offset_y = -1,
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
--rare CORAl
|
||||
mcl_mapgen_core.register_decoration({
|
||||
name = "coral_cora",
|
||||
deco_type = "schematic",
|
||||
place_on = {"group:sand", "mcl_core:gravel"},
|
||||
fill_ratio = 0.0001,
|
||||
|
@ -3644,6 +3671,7 @@ local function register_decorations()
|
|||
schematic = mod_mcl_structures .. "/schematics/coral_cora.mts",
|
||||
rotation = "random",
|
||||
flags = "place_center_x,place_center_z, force_placement",
|
||||
gen_callback = clear_kelp,
|
||||
})
|
||||
|
||||
mcl_mapgen_core.register_decoration({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_structures
|
||||
author = Wuzzy, cora
|
||||
description = Structure placement for MCL2
|
||||
depends = mcl_init, mcl_loot
|
||||
depends = mcl_init, mcl_loot, mcl_ocean
|
||||
|
|
|
@ -117,6 +117,11 @@ local cold = {
|
|||
}
|
||||
}
|
||||
},
|
||||
after_place = function(pos)
|
||||
local minp = vector.offset(pos, -10, -4, 10)
|
||||
local maxp = vector.offset(pos, 10, 2, 10)
|
||||
mcl_ocean.kelp.remove_kelp_below_structure(minp, maxp)
|
||||
end,
|
||||
}
|
||||
|
||||
local warm = table.copy(cold)
|
||||
|
|
|
@ -171,7 +171,12 @@ mcl_structures.register_structure("shipwreck",{
|
|||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
after_place = function(pos)
|
||||
local minp = vector.offset(pos, -10, -4, 10)
|
||||
local maxp = vector.offset(pos, 10, 2, 10)
|
||||
mcl_ocean.kelp.remove_kelp_below_structure(minp, maxp)
|
||||
end,
|
||||
})
|
||||
|
||||
local spawnon = { "mcl_stairs:slab_prismarine_dark"}
|
||||
|
@ -205,6 +210,10 @@ mcl_structures.register_structure("ocean_temple",{
|
|||
mcl_structures.spawn_mobs("mobs_mc:guardian",spawnon,p1,p2,pr,5,true)
|
||||
mcl_structures.spawn_mobs("mobs_mc:guardian_elder",spawnon,p1,p2,pr,1,true)
|
||||
mcl_structures.construct_nodes(p1,p2,{"group:wall"})
|
||||
|
||||
local minp = vector.offset(pos, -10, -4, 10)
|
||||
local maxp = vector.offset(pos, 10, 2, 10)
|
||||
mcl_ocean.kelp.remove_kelp_below_structure(minp, maxp)
|
||||
end,
|
||||
loot = {
|
||||
["mcl_chests:chest_small"] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue