Move the rest
This commit is contained in:
parent
b18e746ead
commit
70a9617c8e
File diff suppressed because it is too large
Load Diff
|
@ -321,121 +321,115 @@ local c_everness_coral_forest_deep_ocean_coral_4 = minetest.get_content_id('ever
|
||||||
-- Biome IDs
|
-- Biome IDs
|
||||||
local biome_id_everness_coral_forest_deep_ocean = minetest.get_biome_id('everness:coral_forest_deep_ocean')
|
local biome_id_everness_coral_forest_deep_ocean = minetest.get_biome_id('everness:coral_forest_deep_ocean')
|
||||||
|
|
||||||
-- Localize data buffer table outside the loop, to be re-used for all
|
local chance = 30
|
||||||
-- mapchunks, therefore minimising memory use.
|
|
||||||
local data = {}
|
|
||||||
local chance = 25
|
|
||||||
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_deep_ocean_house.mts'
|
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_deep_ocean_house.mts'
|
||||||
local size = { x = 11, y = 17, z = 12 }
|
local size = { x = 11, y = 17, z = 12 }
|
||||||
local size_x = math.round(size.x / 2)
|
local size_x = math.round(size.x / 2)
|
||||||
local size_z = math.round(size.z / 2)
|
local size_z = math.round(size.z / 2)
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
local rand = PcgRandom(blockseed)
|
name = 'everness:coral_forest_deep_ocean',
|
||||||
local biomemap = minetest.get_mapgen_object('biomemap')
|
can_run = function(biomemap)
|
||||||
local schem_positions = {}
|
return table.indexof(biomemap, biome_id_everness_coral_forest_deep_ocean) ~= -1
|
||||||
local schem_placed = false
|
end,
|
||||||
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
shared_args.schem_positions = {}
|
||||||
|
local schem_placed = false
|
||||||
|
|
||||||
if table.indexof(biomemap, biome_id_everness_coral_forest_deep_ocean) ~= -1 and rand:next(0, 100) < chance then
|
if rand:next(0, 100) < chance then
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
for y = maxp.y, minp.y, -1 do
|
||||||
local vm, emin, emax = minetest.get_mapgen_object('voxelmanip')
|
if schem_placed then
|
||||||
-- 'area' is used later to get the voxelmanip indexes for positions
|
break
|
||||||
local area = VoxelArea:new({ MinEdge = emin, MaxEdge = emax })
|
end
|
||||||
-- Get the content ID data from the voxelmanip in the form of a flat array.
|
|
||||||
-- Set the buffer parameter to use and reuse 'data' for this.
|
|
||||||
vm:get_data(data)
|
|
||||||
|
|
||||||
for y = maxp.y, minp.y, -1 do
|
for z = minp.z, maxp.z do
|
||||||
for z = minp.z, maxp.z do
|
if schem_placed then
|
||||||
for x = minp.x, maxp.x do
|
break
|
||||||
local vi = area:index(x, y, z)
|
end
|
||||||
|
|
||||||
if
|
for x = minp.x, maxp.x do
|
||||||
data[vi] == c_everness_coral_forest_deep_ocean_sand
|
local vi = area:index(x, y, z)
|
||||||
and data[vi + area.ystride] == c_water_source
|
|
||||||
and not schem_placed
|
|
||||||
then
|
|
||||||
local s_pos = area:position(vi)
|
|
||||||
|
|
||||||
--
|
if
|
||||||
-- Coral Forest Deep Ocean House
|
data[vi] == c_everness_coral_forest_deep_ocean_sand
|
||||||
--
|
and data[vi + area.ystride] == c_water_source
|
||||||
|
then
|
||||||
|
local s_pos = area:position(vi)
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos)
|
--
|
||||||
|
-- Coral Forest Deep Ocean House
|
||||||
|
--
|
||||||
|
|
||||||
-- find floor big enough
|
local schem_pos = vector.new(s_pos)
|
||||||
local indexes = Everness.find_content_in_vm_area(
|
|
||||||
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
|
||||||
{
|
|
||||||
c_everness_coral_forest_deep_ocean_sand,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_plant_1,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_plant_2,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_plant_3,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_1,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_2,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_3,
|
|
||||||
c_everness_coral_forest_deep_ocean_coral_4
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
area
|
|
||||||
)
|
|
||||||
|
|
||||||
if #indexes < size.x * size.z then
|
-- find floor big enough
|
||||||
-- not enough space
|
local indexes = Everness.find_content_in_vm_area(
|
||||||
return
|
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
||||||
end
|
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
||||||
|
{
|
||||||
-- enough water to place structure ?
|
c_everness_coral_forest_deep_ocean_sand,
|
||||||
local water_indexes = Everness.find_content_in_vm_area(
|
c_everness_coral_forest_deep_ocean_coral_plant_1,
|
||||||
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
c_everness_coral_forest_deep_ocean_coral_plant_2,
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
c_everness_coral_forest_deep_ocean_coral_plant_3,
|
||||||
{
|
c_everness_coral_forest_deep_ocean_coral_1,
|
||||||
c_water_source
|
c_everness_coral_forest_deep_ocean_coral_2,
|
||||||
},
|
c_everness_coral_forest_deep_ocean_coral_3,
|
||||||
data,
|
c_everness_coral_forest_deep_ocean_coral_4
|
||||||
area
|
},
|
||||||
)
|
data,
|
||||||
|
area
|
||||||
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
schem_pos,
|
|
||||||
schem,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
schem_placed = true
|
if #indexes < size.x * size.z then
|
||||||
|
-- not enough space
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
schem_positions.everness_coral_forest_deep_ocean_house = schem_positions.everness_coral_forest_deep_ocean_house or {}
|
-- enough water to place structure ?
|
||||||
|
local water_indexes = Everness.find_content_in_vm_area(
|
||||||
|
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
||||||
|
{
|
||||||
|
c_water_source
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
area
|
||||||
|
)
|
||||||
|
|
||||||
table.insert(schem_positions.everness_coral_forest_deep_ocean_house, {
|
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
||||||
pos = schem_pos,
|
minetest.place_schematic_on_vmanip(
|
||||||
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
vm,
|
||||||
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
schem_pos,
|
||||||
})
|
schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Coral Forest Deep Ocean House was placed at ' .. schem_pos:to_string())
|
schem_placed = true
|
||||||
|
|
||||||
|
shared_args.schem_positions.everness_coral_forest_deep_ocean_house = shared_args.schem_positions.everness_coral_forest_deep_ocean_house or {}
|
||||||
|
|
||||||
|
table.insert(shared_args.schem_positions.everness_coral_forest_deep_ocean_house, {
|
||||||
|
pos = schem_pos,
|
||||||
|
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Coral Forest Deep Ocean House was placed at ' .. schem_pos:to_string())
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
after_write_to_map = function(shared_args)
|
||||||
|
local schem_positions = shared_args.schem_positions or {}
|
||||||
|
|
||||||
-- Set the lighting within the `VoxelManip` to a uniform value
|
|
||||||
vm:set_lighting({ day = 0, night = 0 }, minp, maxp)
|
|
||||||
-- Calculate lighting for what has been created.
|
|
||||||
vm:calc_lighting()
|
|
||||||
-- Liquid nodes were placed so set them flowing.
|
|
||||||
vm:update_liquids()
|
|
||||||
-- Write what has been created to the world.
|
|
||||||
vm:write_to_map()
|
|
||||||
minetest.fix_light(minp, maxp)
|
|
||||||
|
|
||||||
-- Populate loot chests
|
|
||||||
for name, tbl in pairs(schem_positions) do
|
for name, tbl in pairs(schem_positions) do
|
||||||
if next(tbl) then
|
if next(tbl) then
|
||||||
for i, v in ipairs(tbl) do
|
for i, v in ipairs(tbl) do
|
||||||
|
@ -452,4 +446,4 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -184,7 +184,7 @@ Everness:register_decoration({
|
||||||
--
|
--
|
||||||
|
|
||||||
local disp = 16
|
local disp = 16
|
||||||
local chance = 10
|
local chance = 5
|
||||||
local water_level = tonumber(minetest.settings:get('water_level')) or 1
|
local water_level = tonumber(minetest.settings:get('water_level')) or 1
|
||||||
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_ocean_fishing_dock.mts'
|
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_ocean_fishing_dock.mts'
|
||||||
local size = { x = 26, y = 10, z = 23 }
|
local size = { x = 26, y = 10, z = 23 }
|
||||||
|
@ -207,73 +207,76 @@ Everness:add_to_queue_on_generated({
|
||||||
local z_disp = rand:next(0, disp)
|
local z_disp = rand:next(0, disp)
|
||||||
shared_args.schem_positions = {}
|
shared_args.schem_positions = {}
|
||||||
|
|
||||||
for y = minp.y, maxp.y do
|
if rand:next(0, 100) < chance then
|
||||||
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)
|
for y = minp.y, maxp.y do
|
||||||
|
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)
|
||||||
|
|
||||||
if data[vi + area.ystride] == minetest.CONTENT_AIR
|
if data[vi + area.ystride] == minetest.CONTENT_AIR
|
||||||
and data[vi] == c_water_source
|
and data[vi] == c_water_source
|
||||||
and rand:next(0, 100) < chance
|
-- Water Level
|
||||||
-- Water Level
|
and water_level >= minp.y
|
||||||
and water_level >= minp.y
|
and water_level <= maxp.y
|
||||||
and water_level <= maxp.y
|
then
|
||||||
then
|
local s_pos = area:position(vi)
|
||||||
local s_pos = area:position(vi)
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Coral Forest Ocean Fishing Dock
|
-- Coral Forest Ocean Fishing Dock
|
||||||
--
|
--
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos.x, s_pos.y - y_dis, s_pos.z)
|
local schem_pos = vector.new(s_pos.x, s_pos.y - y_dis, s_pos.z)
|
||||||
|
|
||||||
-- find floor big enough
|
-- find floor big enough
|
||||||
local indexes = Everness.find_content_in_vm_area(
|
local indexes = Everness.find_content_in_vm_area(
|
||||||
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
||||||
{
|
{
|
||||||
c_water_source,
|
c_water_source,
|
||||||
minetest.CONTENT_AIR
|
minetest.CONTENT_AIR
|
||||||
},
|
},
|
||||||
data,
|
data,
|
||||||
area
|
area
|
||||||
)
|
|
||||||
|
|
||||||
if #indexes < size.x * size.z then
|
|
||||||
-- not enough space
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- enough space to place structure ?
|
|
||||||
local space_indexes = Everness.find_content_in_vm_area(
|
|
||||||
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
|
||||||
{
|
|
||||||
c_water_source,
|
|
||||||
minetest.CONTENT_AIR
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
area
|
|
||||||
)
|
|
||||||
|
|
||||||
if #space_indexes > (size.x * size.y * size.z) / 2 then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
schem_pos,
|
|
||||||
schem,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock = shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock or {}
|
if #indexes < size.x * size.z then
|
||||||
|
-- not enough space
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock, {
|
-- enough space to place structure ?
|
||||||
pos = schem_pos,
|
local space_indexes = Everness.find_content_in_vm_area(
|
||||||
minp = vector.new(s_pos.x - size_x, s_pos.y - y_dis, s_pos.z - size_z),
|
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
maxp = vector.new(s_pos.x + size_x, s_pos.y - y_dis + size.y, s_pos.z + size_z)
|
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
||||||
})
|
{
|
||||||
|
c_water_source,
|
||||||
|
minetest.CONTENT_AIR
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
area
|
||||||
|
)
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Coral Forest Ocean Fishing Dock was placed at ' .. schem_pos:to_string())
|
if #space_indexes > (size.x * size.y * size.z) / 2 then
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
schem_pos,
|
||||||
|
schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock = shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock or {}
|
||||||
|
|
||||||
|
table.insert(shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock, {
|
||||||
|
pos = schem_pos,
|
||||||
|
minp = vector.new(s_pos.x - size_x, s_pos.y - y_dis, s_pos.z - size_z),
|
||||||
|
maxp = vector.new(s_pos.x + size_x, s_pos.y - y_dis + size.y, s_pos.z + size_z)
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Coral Forest Ocean Fishing Dock was placed at ' .. schem_pos:to_string())
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -165,7 +165,7 @@ Everness:register_decoration({
|
||||||
--
|
--
|
||||||
|
|
||||||
local disp = 16
|
local disp = 16
|
||||||
local chance = 10
|
local chance = 5
|
||||||
local water_level = tonumber(minetest.settings:get('water_level')) or 1
|
local water_level = tonumber(minetest.settings:get('water_level')) or 1
|
||||||
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_ocean_fishing_dock.mts'
|
local schem = minetest.get_modpath('everness') .. '/schematics/everness_coral_forest_ocean_fishing_dock.mts'
|
||||||
local size = { x = 26, y = 10, z = 23 }
|
local size = { x = 26, y = 10, z = 23 }
|
||||||
|
@ -188,73 +188,76 @@ Everness:add_to_queue_on_generated({
|
||||||
local z_disp = rand:next(0, disp)
|
local z_disp = rand:next(0, disp)
|
||||||
shared_args.schem_positions = {}
|
shared_args.schem_positions = {}
|
||||||
|
|
||||||
for y = minp.y, maxp.y do
|
if rand:next(0, 100) < chance then
|
||||||
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)
|
for y = minp.y, maxp.y do
|
||||||
|
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)
|
||||||
|
|
||||||
if data[vi + area.ystride] == minetest.CONTENT_AIR
|
if data[vi + area.ystride] == minetest.CONTENT_AIR
|
||||||
and data[vi] == c_water_source
|
and data[vi] == c_water_source
|
||||||
and rand:next(0, 100) < chance
|
-- Water Level
|
||||||
-- Water Level
|
and water_level >= minp.y
|
||||||
and water_level >= minp.y
|
and water_level <= maxp.y
|
||||||
and water_level <= maxp.y
|
then
|
||||||
then
|
local s_pos = area:position(vi)
|
||||||
local s_pos = area:position(vi)
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Coral Forest Ocean Fishing Dock
|
-- Coral Forest Ocean Fishing Dock
|
||||||
--
|
--
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos.x, s_pos.y - y_dis, s_pos.z)
|
local schem_pos = vector.new(s_pos.x, s_pos.y - y_dis, s_pos.z)
|
||||||
|
|
||||||
-- find floor big enough
|
-- find floor big enough
|
||||||
local indexes = Everness.find_content_in_vm_area(
|
local indexes = Everness.find_content_in_vm_area(
|
||||||
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
||||||
{
|
{
|
||||||
c_water_source,
|
c_water_source,
|
||||||
minetest.CONTENT_AIR
|
minetest.CONTENT_AIR
|
||||||
},
|
},
|
||||||
data,
|
data,
|
||||||
area
|
area
|
||||||
)
|
|
||||||
|
|
||||||
if #indexes < size.x * size.z then
|
|
||||||
-- not enough space
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- enough space to place structure ?
|
|
||||||
local space_indexes = Everness.find_content_in_vm_area(
|
|
||||||
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
|
||||||
{
|
|
||||||
c_water_source,
|
|
||||||
minetest.CONTENT_AIR
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
area
|
|
||||||
)
|
|
||||||
|
|
||||||
if #space_indexes > (size.x * size.y * size.z) / 2 then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
schem_pos,
|
|
||||||
schem,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock = shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock or {}
|
if #indexes < size.x * size.z then
|
||||||
|
-- not enough space
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock, {
|
-- enough space to place structure ?
|
||||||
pos = schem_pos,
|
local space_indexes = Everness.find_content_in_vm_area(
|
||||||
minp = vector.new(s_pos.x - size_x, s_pos.y - y_dis, s_pos.z - size_z),
|
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
maxp = vector.new(s_pos.x + size_x, s_pos.y - y_dis + size.y, s_pos.z + size_z)
|
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
||||||
})
|
{
|
||||||
|
c_water_source,
|
||||||
|
minetest.CONTENT_AIR
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
area
|
||||||
|
)
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Coral Forest Ocean Fishing Dock was placed at ' .. schem_pos:to_string())
|
if #space_indexes > (size.x * size.y * size.z) / 2 then
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
schem_pos,
|
||||||
|
schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock = shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock or {}
|
||||||
|
|
||||||
|
table.insert(shared_args.schem_positions.everness_coral_forest_ocean_fishing_dock, {
|
||||||
|
pos = schem_pos,
|
||||||
|
minp = vector.new(s_pos.x - size_x, s_pos.y - y_dis, s_pos.z - size_z),
|
||||||
|
maxp = vector.new(s_pos.x + size_x, s_pos.y - y_dis + size.y, s_pos.z + size_z)
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Coral Forest Ocean Fishing Dock was placed at ' .. schem_pos:to_string())
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -213,6 +213,8 @@ Everness:register_decoration({
|
||||||
-- On Generated
|
-- On Generated
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local biome_id_everness_coral_forest_under = minetest.get_biome_id('everness:coral_forest_under')
|
||||||
|
|
||||||
local deco_id_coral_forest_under_coral_tree_bioluminescent = minetest.get_decoration_id('everness:coral_forest_under_coral_tree_bioluminescent')
|
local deco_id_coral_forest_under_coral_tree_bioluminescent = minetest.get_decoration_id('everness:coral_forest_under_coral_tree_bioluminescent')
|
||||||
|
|
||||||
local schem_bioluminescent_tree = minetest.get_modpath('everness') .. '/schematics/everness_coral_tree_bioluminescent.mts'
|
local schem_bioluminescent_tree = minetest.get_modpath('everness') .. '/schematics/everness_coral_tree_bioluminescent.mts'
|
||||||
|
@ -226,78 +228,79 @@ bioluminescent_tree_place_on = type(bioluminescent_tree_place_on) == 'string' an
|
||||||
|
|
||||||
minetest.set_gen_notify({ decoration = true }, { deco_id_coral_forest_under_coral_tree_bioluminescent })
|
minetest.set_gen_notify({ decoration = true }, { deco_id_coral_forest_under_coral_tree_bioluminescent })
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
name = 'everness:coral_forest_under',
|
||||||
local vm = minetest.get_mapgen_object('voxelmanip')
|
can_run = function(biomemap)
|
||||||
-- Returns a table mapping requested generation notification types to arrays of positions at which the corresponding generated structures are located within the current chunk
|
return table.indexof(biomemap, biome_id_everness_coral_forest_under) ~= -1
|
||||||
local gennotify = minetest.get_mapgen_object('gennotify')
|
end,
|
||||||
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
--
|
||||||
|
-- Coral Tree Bioluminescent
|
||||||
|
--
|
||||||
|
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_coral_forest_under_coral_tree_bioluminescent or '')] or {}) do
|
||||||
|
-- `pos` is position of the 'place_on' node
|
||||||
|
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||||
|
local marker_node = minetest.get_node(marker_pos)
|
||||||
|
local place_on_node = minetest.get_node(pos)
|
||||||
|
|
||||||
--
|
if not marker_node then
|
||||||
-- Coral Tree Bioluminescent
|
return
|
||||||
--
|
end
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_coral_forest_under_coral_tree_bioluminescent or '')] or {}) do
|
|
||||||
-- `pos` is position of the 'place_on' node
|
|
||||||
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
|
||||||
local marker_node = minetest.get_node(marker_pos)
|
|
||||||
local place_on_node = minetest.get_node(pos)
|
|
||||||
|
|
||||||
if not marker_node then
|
if marker_node.name ~= 'everness:marker' then
|
||||||
return
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
end
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if marker_node.name ~= 'everness:marker' then
|
minetest.remove_node(marker_pos)
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.remove_node(marker_pos)
|
if table.indexof(bioluminescent_tree_place_on, place_on_node.name) == -1 then
|
||||||
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if table.indexof(bioluminescent_tree_place_on, place_on_node.name) == -1 then
|
-- no need to check for the floor "big enough" size since its a tree and has ~ 1x1 base size
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- no need to check for the floor "big enough" size since its a tree and has ~ 1x1 base size
|
-- enough air to place structure ?
|
||||||
|
local positions = minetest.find_nodes_in_area(
|
||||||
-- enough air to place structure ?
|
vector.new(
|
||||||
local positions = minetest.find_nodes_in_area(
|
pos.x - bioluminescent_tree_size_x,
|
||||||
vector.new(
|
pos.y - bioluminescent_tree_y_dis,
|
||||||
pos.x - bioluminescent_tree_size_x,
|
pos.z - bioluminescent_tree_size_z
|
||||||
pos.y - bioluminescent_tree_y_dis,
|
),
|
||||||
pos.z - bioluminescent_tree_size_z
|
vector.new(
|
||||||
),
|
pos.x + bioluminescent_tree_size_x,
|
||||||
vector.new(
|
pos.y - bioluminescent_tree_y_dis + coral_bioluminescent_tree_size.y,
|
||||||
pos.x + bioluminescent_tree_size_x,
|
pos.z + bioluminescent_tree_size_z
|
||||||
pos.y - bioluminescent_tree_y_dis + coral_bioluminescent_tree_size.y,
|
),
|
||||||
pos.z + bioluminescent_tree_size_z
|
{
|
||||||
),
|
'air',
|
||||||
{
|
'everness:coral_tree'
|
||||||
'air',
|
},
|
||||||
'everness:coral_tree'
|
true
|
||||||
},
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
local air = positions.air or {}
|
|
||||||
local tree = positions['everness:coral_tree'] or {}
|
|
||||||
|
|
||||||
if #tree > 1 then
|
|
||||||
-- will overlap another tree
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if #air > bioluminescent_tree_safe_volume then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
vector.new(marker_pos.x, marker_pos.y - bioluminescent_tree_y_dis, marker_pos.z),
|
|
||||||
schem_bioluminescent_tree,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
-- minetest.log('action', '[Everness] Coral Tree Bioluminescent was placed at ' .. pos:to_string())
|
local air = positions.air or {}
|
||||||
|
local tree = positions['everness:coral_tree'] or {}
|
||||||
|
|
||||||
|
if #tree > 1 then
|
||||||
|
-- will overlap another tree
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if #air > bioluminescent_tree_safe_volume then
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
vector.new(marker_pos.x, marker_pos.y - bioluminescent_tree_y_dis, marker_pos.z),
|
||||||
|
schem_bioluminescent_tree,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
-- minetest.log('action', '[Everness] Coral Tree Bioluminescent was placed at ' .. pos:to_string())
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -190,120 +190,114 @@ local c_everness_crystal_forest_deep_ocean_coral_3 = minetest.get_content_id('ev
|
||||||
-- Biome IDs
|
-- Biome IDs
|
||||||
local biome_id_everness_crystal_forest_deep_ocean = minetest.get_biome_id('everness:crystal_forest_deep_ocean')
|
local biome_id_everness_crystal_forest_deep_ocean = minetest.get_biome_id('everness:crystal_forest_deep_ocean')
|
||||||
|
|
||||||
-- Localize data buffer table outside the loop, to be re-used for all
|
local chance = 30
|
||||||
-- mapchunks, therefore minimising memory use.
|
|
||||||
local data = {}
|
|
||||||
local chance = 25
|
|
||||||
local schem = minetest.get_modpath('everness') .. '/schematics/everness_crystal_forest_deep_ocean_ruins.mts'
|
local schem = minetest.get_modpath('everness') .. '/schematics/everness_crystal_forest_deep_ocean_ruins.mts'
|
||||||
local size = { x = 14, y = 12, z = 9 }
|
local size = { x = 14, y = 12, z = 9 }
|
||||||
local size_x = math.round(size.x / 2)
|
local size_x = math.round(size.x / 2)
|
||||||
local size_z = math.round(size.z / 2)
|
local size_z = math.round(size.z / 2)
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
local rand = PcgRandom(blockseed)
|
name = 'everness:crystal_forest_deep_ocean',
|
||||||
local biomemap = minetest.get_mapgen_object('biomemap')
|
can_run = function(biomemap)
|
||||||
local schem_positions = {}
|
return table.indexof(biomemap, biome_id_everness_crystal_forest_deep_ocean) ~= -1
|
||||||
local schem_placed = false
|
end,
|
||||||
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
shared_args.schem_positions = {}
|
||||||
|
local schem_placed = false
|
||||||
|
|
||||||
if table.indexof(biomemap, biome_id_everness_crystal_forest_deep_ocean) ~= -1 and rand:next(0, 100) < chance then
|
if rand:next(0, 100) < chance then
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
for y = maxp.y, minp.y, -1 do
|
||||||
local vm, emin, emax = minetest.get_mapgen_object('voxelmanip')
|
if schem_placed then
|
||||||
-- 'area' is used later to get the voxelmanip indexes for positions
|
break
|
||||||
local area = VoxelArea:new({ MinEdge = emin, MaxEdge = emax })
|
end
|
||||||
-- Get the content ID data from the voxelmanip in the form of a flat array.
|
|
||||||
-- Set the buffer parameter to use and reuse 'data' for this.
|
|
||||||
vm:get_data(data)
|
|
||||||
|
|
||||||
for y = maxp.y, minp.y, -1 do
|
for z = minp.z, maxp.z do
|
||||||
for z = minp.z, maxp.z do
|
if schem_placed then
|
||||||
for x = minp.x, maxp.x do
|
break
|
||||||
local vi = area:index(x, y, z)
|
end
|
||||||
|
|
||||||
if
|
for x = minp.x, maxp.x do
|
||||||
data[vi] == c_everness_crystal_forest_deep_ocean_sand
|
local vi = area:index(x, y, z)
|
||||||
and data[vi + area.ystride] == c_water_source
|
|
||||||
and not schem_placed
|
|
||||||
then
|
|
||||||
local s_pos = area:position(vi)
|
|
||||||
|
|
||||||
--
|
if
|
||||||
-- Crystal Forest Deep Ocean Ruins
|
data[vi] == c_everness_crystal_forest_deep_ocean_sand
|
||||||
--
|
and data[vi + area.ystride] == c_water_source
|
||||||
|
then
|
||||||
|
local s_pos = area:position(vi)
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos)
|
--
|
||||||
|
-- Crystal Forest Deep Ocean Ruins
|
||||||
|
--
|
||||||
|
|
||||||
-- find floor big enough
|
local schem_pos = vector.new(s_pos)
|
||||||
local indexes = Everness.find_content_in_vm_area(
|
|
||||||
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
|
||||||
{
|
|
||||||
c_everness_crystal_forest_deep_ocean_sand,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_plant_1,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_plant_2,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_plant_3,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_1,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_2,
|
|
||||||
c_everness_crystal_forest_deep_ocean_coral_3
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
area
|
|
||||||
)
|
|
||||||
|
|
||||||
if #indexes < size.x * size.z then
|
-- find floor big enough
|
||||||
-- not enough space
|
local indexes = Everness.find_content_in_vm_area(
|
||||||
return
|
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
||||||
end
|
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
||||||
|
{
|
||||||
-- enough water to place structure ?
|
c_everness_crystal_forest_deep_ocean_sand,
|
||||||
local water_indexes = Everness.find_content_in_vm_area(
|
c_everness_crystal_forest_deep_ocean_coral_plant_1,
|
||||||
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
c_everness_crystal_forest_deep_ocean_coral_plant_2,
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
c_everness_crystal_forest_deep_ocean_coral_plant_3,
|
||||||
{
|
c_everness_crystal_forest_deep_ocean_coral_1,
|
||||||
c_water_source
|
c_everness_crystal_forest_deep_ocean_coral_2,
|
||||||
},
|
c_everness_crystal_forest_deep_ocean_coral_3
|
||||||
data,
|
},
|
||||||
area
|
data,
|
||||||
)
|
area
|
||||||
|
|
||||||
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
schem_pos,
|
|
||||||
schem,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
schem_placed = true
|
if #indexes < size.x * size.z then
|
||||||
|
-- not enough space
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
schem_positions.everness_crystal_forest_deep_ocean_ruins = schem_positions.everness_crystal_forest_deep_ocean_ruins or {}
|
-- enough water to place structure ?
|
||||||
|
local water_indexes = Everness.find_content_in_vm_area(
|
||||||
|
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
||||||
|
{
|
||||||
|
c_water_source
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
area
|
||||||
|
)
|
||||||
|
|
||||||
table.insert(schem_positions.everness_crystal_forest_deep_ocean_ruins, {
|
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
||||||
pos = schem_pos,
|
minetest.place_schematic_on_vmanip(
|
||||||
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
vm,
|
||||||
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
schem_pos,
|
||||||
})
|
schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Crystal Forest Deep Ocean Ruins was placed at ' .. schem_pos:to_string())
|
schem_placed = true
|
||||||
|
|
||||||
|
shared_args.schem_positions.everness_crystal_forest_deep_ocean_ruins = shared_args.schem_positions.everness_crystal_forest_deep_ocean_ruins or {}
|
||||||
|
|
||||||
|
table.insert(shared_args.schem_positions.everness_crystal_forest_deep_ocean_ruins, {
|
||||||
|
pos = schem_pos,
|
||||||
|
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Crystal Forest Deep Ocean Ruins was placed at ' .. schem_pos:to_string())
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
after_write_to_map = function(shared_args)
|
||||||
|
local schem_positions = shared_args.schem_positions or {}
|
||||||
|
|
||||||
-- Set the lighting within the `VoxelManip` to a uniform value
|
|
||||||
vm:set_lighting({ day = 0, night = 0 }, minp, maxp)
|
|
||||||
-- Calculate lighting for what has been created.
|
|
||||||
vm:calc_lighting()
|
|
||||||
-- Liquid nodes were placed so set them flowing.
|
|
||||||
vm:update_liquids()
|
|
||||||
-- Write what has been created to the world.
|
|
||||||
vm:write_to_map()
|
|
||||||
minetest.fix_light(minp, maxp)
|
|
||||||
|
|
||||||
-- Populate loot chests
|
|
||||||
for name, tbl in pairs(schem_positions) do
|
for name, tbl in pairs(schem_positions) do
|
||||||
if next(tbl) then
|
if next(tbl) then
|
||||||
for i, v in ipairs(tbl) do
|
for i, v in ipairs(tbl) do
|
||||||
|
@ -320,4 +314,4 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -222,6 +222,8 @@ Everness:register_decoration({
|
||||||
-- On Generated
|
-- On Generated
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local biome_id_everness_crystal_forest_under = minetest.get_biome_id('everness:crystal_forest_under')
|
||||||
|
|
||||||
local deco_id_crystal_forest_under_crystal_cluster = minetest.get_decoration_id('everness:crystal_forest_under_crystal_cluster')
|
local deco_id_crystal_forest_under_crystal_cluster = minetest.get_decoration_id('everness:crystal_forest_under_crystal_cluster')
|
||||||
local deco_id_crystal_forest_under_crystal_sphere_cluster = minetest.get_decoration_id('everness:crystal_forest_under_crystal_sphere_cluster')
|
local deco_id_crystal_forest_under_crystal_sphere_cluster = minetest.get_decoration_id('everness:crystal_forest_under_crystal_sphere_cluster')
|
||||||
|
|
||||||
|
@ -248,174 +250,174 @@ minetest.set_gen_notify({ decoration = true }, {
|
||||||
deco_id_crystal_forest_under_crystal_sphere_cluster
|
deco_id_crystal_forest_under_crystal_sphere_cluster
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
local rand = PcgRandom(blockseed)
|
name = 'everness:crystal_forest_under',
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
can_run = function(biomemap)
|
||||||
local vm = minetest.get_mapgen_object('voxelmanip')
|
return table.indexof(biomemap, biome_id_everness_crystal_forest_under) ~= -1
|
||||||
-- Returns a table mapping requested generation notification types to arrays of positions at which the corresponding generated structures are located within the current chunk
|
end,
|
||||||
local gennotify = minetest.get_mapgen_object('gennotify')
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
--
|
||||||
|
-- Crystal Cluster
|
||||||
|
--
|
||||||
|
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_crystal_forest_under_crystal_cluster or '')] or {}) do
|
||||||
|
-- `pos` is position of the 'place_on' node
|
||||||
|
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||||
|
local marker_node = minetest.get_node(marker_pos)
|
||||||
|
local place_on_node = minetest.get_node(pos)
|
||||||
|
|
||||||
--
|
if not marker_node then
|
||||||
-- Crystal Cluster
|
return
|
||||||
--
|
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_crystal_forest_under_crystal_cluster or '')] or {}) do
|
|
||||||
-- `pos` is position of the 'place_on' node
|
|
||||||
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
|
||||||
local marker_node = minetest.get_node(marker_pos)
|
|
||||||
local place_on_node = minetest.get_node(pos)
|
|
||||||
|
|
||||||
if not marker_node then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if marker_node.name ~= 'everness:marker' then
|
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.remove_node(marker_pos)
|
|
||||||
|
|
||||||
if table.indexof(crystal_cluster_place_on, place_on_node.name) == -1 then
|
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- enough air to place structure ?
|
|
||||||
local positions = minetest.find_nodes_in_area(
|
|
||||||
vector.new(
|
|
||||||
pos.x - crystal_cluster_size_x,
|
|
||||||
pos.y,
|
|
||||||
pos.z - crystal_cluster_size_z
|
|
||||||
),
|
|
||||||
vector.new(
|
|
||||||
pos.x + crystal_cluster_size_x,
|
|
||||||
pos.y + crystal_cluster_size.y,
|
|
||||||
pos.z + crystal_cluster_size_z
|
|
||||||
),
|
|
||||||
{
|
|
||||||
'air'
|
|
||||||
},
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
local air = positions.air or {}
|
|
||||||
|
|
||||||
if #air > crystal_cluster_safe_volume then
|
|
||||||
local replacements
|
|
||||||
local rand_color
|
|
||||||
|
|
||||||
if rand:next(0, 100) < 25 then
|
|
||||||
local colors = { 'purple', 'cyan' }
|
|
||||||
rand_color = colors[rand:next(1, #colors)]
|
|
||||||
|
|
||||||
replacements = {
|
|
||||||
['everness:crystal_block_orange'] = 'everness:crystal_block_' .. rand_color,
|
|
||||||
['everness:crystal_orange'] = 'everness:crystal_' .. rand_color
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.place_schematic_on_vmanip(
|
if marker_node.name ~= 'everness:marker' then
|
||||||
vm,
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
vector.new(marker_pos.x, marker_pos.y, marker_pos.z),
|
return
|
||||||
schem_crystal_cluster,
|
|
||||||
'random',
|
|
||||||
replacements,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
|
||||||
|
|
||||||
-- minetest.log('action', '[Everness] Crystal Cluster ' .. (rand_color or 'orange') .. ' was placed at ' .. pos:to_string())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Crystal Sphere Cluster
|
|
||||||
--
|
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_crystal_forest_under_crystal_sphere_cluster or '')] or {}) do
|
|
||||||
-- `pos` is position of the 'place_on' node
|
|
||||||
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
|
||||||
local marker_node = minetest.get_node(marker_pos)
|
|
||||||
local place_on_node = minetest.get_node(pos)
|
|
||||||
local crystal_sphere_cluster_y_dis = rand:next(5, 9)
|
|
||||||
|
|
||||||
if not marker_node then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if marker_node.name ~= 'everness:marker' then
|
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.remove_node(marker_pos)
|
|
||||||
|
|
||||||
if table.indexof(crystal_sphere_cluster_place_on, place_on_node.name) == -1 then
|
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- enough air to place structure ?
|
|
||||||
local positions = minetest.find_nodes_in_area(
|
|
||||||
vector.new(
|
|
||||||
pos.x - crystal_sphere_cluster_size_x,
|
|
||||||
pos.y - crystal_sphere_cluster_y_dis,
|
|
||||||
pos.z - crystal_sphere_cluster_size_z
|
|
||||||
),
|
|
||||||
vector.new(
|
|
||||||
pos.x + crystal_sphere_cluster_size_x,
|
|
||||||
pos.y - crystal_sphere_cluster_y_dis + crystal_sphere_cluster_size.y,
|
|
||||||
pos.z + crystal_sphere_cluster_size_z
|
|
||||||
),
|
|
||||||
{
|
|
||||||
'air',
|
|
||||||
'everness:coral_tree',
|
|
||||||
'everness:crystal_block_orange',
|
|
||||||
'everness:crystal_block_purple',
|
|
||||||
'everness:crystal_block_cyan',
|
|
||||||
},
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
local air = positions.air or {}
|
|
||||||
local tree = positions['everness:coral_tree'] or {}
|
|
||||||
local block_orange = positions['everness:crystal_block_orange'] or {}
|
|
||||||
local block_purple = positions['everness:crystal_block_purple'] or {}
|
|
||||||
local block_cyan = positions['everness:crystal_block_cyan'] or {}
|
|
||||||
|
|
||||||
if #tree > 0
|
|
||||||
or #block_orange > 0
|
|
||||||
or #block_purple > 0
|
|
||||||
or #block_cyan > 0
|
|
||||||
then
|
|
||||||
-- will overlap
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if #air > crystal_sphere_cluster_safe_volume then
|
|
||||||
local replacements
|
|
||||||
local rand_color
|
|
||||||
|
|
||||||
if rand:next(0, 100) < 25 then
|
|
||||||
local colors = { 'orange', 'cyan' }
|
|
||||||
rand_color = colors[rand:next(1, #colors)]
|
|
||||||
|
|
||||||
replacements = {
|
|
||||||
['everness:crystal_block_purple'] = 'everness:crystal_block_' .. rand_color,
|
|
||||||
['everness:crystal_purple'] = 'everness:crystal_' .. rand_color
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.place_schematic_on_vmanip(
|
minetest.remove_node(marker_pos)
|
||||||
vm,
|
|
||||||
vector.new(marker_pos.x, marker_pos.y - crystal_sphere_cluster_y_dis, marker_pos.z),
|
if table.indexof(crystal_cluster_place_on, place_on_node.name) == -1 then
|
||||||
schem_crystal_sphere_cluster,
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
'random',
|
return
|
||||||
replacements,
|
end
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
-- enough air to place structure ?
|
||||||
|
local positions = minetest.find_nodes_in_area(
|
||||||
|
vector.new(
|
||||||
|
pos.x - crystal_cluster_size_x,
|
||||||
|
pos.y,
|
||||||
|
pos.z - crystal_cluster_size_z
|
||||||
|
),
|
||||||
|
vector.new(
|
||||||
|
pos.x + crystal_cluster_size_x,
|
||||||
|
pos.y + crystal_cluster_size.y,
|
||||||
|
pos.z + crystal_cluster_size_z
|
||||||
|
),
|
||||||
|
{
|
||||||
|
'air'
|
||||||
|
},
|
||||||
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
-- minetest.log('action', '[Everness] Crystal Sphere Cluster ' .. (rand_color or 'orange') .. ' was placed at ' .. pos:to_string())
|
local air = positions.air or {}
|
||||||
|
|
||||||
|
if #air > crystal_cluster_safe_volume then
|
||||||
|
local replacements
|
||||||
|
local rand_color
|
||||||
|
|
||||||
|
if rand:next(0, 100) < 25 then
|
||||||
|
local colors = { 'purple', 'cyan' }
|
||||||
|
rand_color = colors[rand:next(1, #colors)]
|
||||||
|
|
||||||
|
replacements = {
|
||||||
|
['everness:crystal_block_orange'] = 'everness:crystal_block_' .. rand_color,
|
||||||
|
['everness:crystal_orange'] = 'everness:crystal_' .. rand_color
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
vector.new(marker_pos.x, marker_pos.y, marker_pos.z),
|
||||||
|
schem_crystal_cluster,
|
||||||
|
'random',
|
||||||
|
replacements,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
-- minetest.log('action', '[Everness] Crystal Cluster ' .. (rand_color or 'orange') .. ' was placed at ' .. pos:to_string())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Crystal Sphere Cluster
|
||||||
|
--
|
||||||
|
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_crystal_forest_under_crystal_sphere_cluster or '')] or {}) do
|
||||||
|
-- `pos` is position of the 'place_on' node
|
||||||
|
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||||
|
local marker_node = minetest.get_node(marker_pos)
|
||||||
|
local place_on_node = minetest.get_node(pos)
|
||||||
|
local crystal_sphere_cluster_y_dis = rand:next(5, 9)
|
||||||
|
|
||||||
|
if not marker_node then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if marker_node.name ~= 'everness:marker' then
|
||||||
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.remove_node(marker_pos)
|
||||||
|
|
||||||
|
if table.indexof(crystal_sphere_cluster_place_on, place_on_node.name) == -1 then
|
||||||
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- enough air to place structure ?
|
||||||
|
local positions = minetest.find_nodes_in_area(
|
||||||
|
vector.new(
|
||||||
|
pos.x - crystal_sphere_cluster_size_x,
|
||||||
|
pos.y - crystal_sphere_cluster_y_dis,
|
||||||
|
pos.z - crystal_sphere_cluster_size_z
|
||||||
|
),
|
||||||
|
vector.new(
|
||||||
|
pos.x + crystal_sphere_cluster_size_x,
|
||||||
|
pos.y - crystal_sphere_cluster_y_dis + crystal_sphere_cluster_size.y,
|
||||||
|
pos.z + crystal_sphere_cluster_size_z
|
||||||
|
),
|
||||||
|
{
|
||||||
|
'air',
|
||||||
|
'everness:coral_tree',
|
||||||
|
'everness:crystal_block_orange',
|
||||||
|
'everness:crystal_block_purple',
|
||||||
|
'everness:crystal_block_cyan',
|
||||||
|
},
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
|
local air = positions.air or {}
|
||||||
|
local tree = positions['everness:coral_tree'] or {}
|
||||||
|
local block_orange = positions['everness:crystal_block_orange'] or {}
|
||||||
|
local block_purple = positions['everness:crystal_block_purple'] or {}
|
||||||
|
local block_cyan = positions['everness:crystal_block_cyan'] or {}
|
||||||
|
|
||||||
|
if #tree > 0
|
||||||
|
or #block_orange > 0
|
||||||
|
or #block_purple > 0
|
||||||
|
or #block_cyan > 0
|
||||||
|
then
|
||||||
|
-- will overlap
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if #air > crystal_sphere_cluster_safe_volume then
|
||||||
|
local replacements
|
||||||
|
local rand_color
|
||||||
|
|
||||||
|
if rand:next(0, 100) < 25 then
|
||||||
|
local colors = { 'orange', 'cyan' }
|
||||||
|
rand_color = colors[rand:next(1, #colors)]
|
||||||
|
|
||||||
|
replacements = {
|
||||||
|
['everness:crystal_block_purple'] = 'everness:crystal_block_' .. rand_color,
|
||||||
|
['everness:crystal_purple'] = 'everness:crystal_' .. rand_color
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
vector.new(marker_pos.x, marker_pos.y - crystal_sphere_cluster_y_dis, marker_pos.z),
|
||||||
|
schem_crystal_sphere_cluster,
|
||||||
|
'random',
|
||||||
|
replacements,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
-- minetest.log('action', '[Everness] Crystal Sphere Cluster ' .. (rand_color or 'orange') .. ' was placed at ' .. pos:to_string())
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -190,120 +190,114 @@ local c_everness_cursed_lands_deep_ocean_coral_octocurse = minetest.get_content_
|
||||||
-- Biome IDs
|
-- Biome IDs
|
||||||
local biome_id_everness_cursed_lands_deep_ocean = minetest.get_biome_id('everness:cursed_lands_deep_ocean')
|
local biome_id_everness_cursed_lands_deep_ocean = minetest.get_biome_id('everness:cursed_lands_deep_ocean')
|
||||||
|
|
||||||
-- Localize data buffer table outside the loop, to be re-used for all
|
local chance = 30
|
||||||
-- mapchunks, therefore minimising memory use.
|
|
||||||
local data = {}
|
|
||||||
local chance = 20
|
|
||||||
local schem = minetest.get_modpath('everness') .. '/schematics/everness_cursed_lands_deep_ocean_skull.mts'
|
local schem = minetest.get_modpath('everness') .. '/schematics/everness_cursed_lands_deep_ocean_skull.mts'
|
||||||
local size = { x = 10, y = 11, z = 11 }
|
local size = { x = 10, y = 11, z = 11 }
|
||||||
local size_x = math.round(size.x / 2)
|
local size_x = math.round(size.x / 2)
|
||||||
local size_z = math.round(size.z / 2)
|
local size_z = math.round(size.z / 2)
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
local rand = PcgRandom(blockseed)
|
name = 'everness:cursed_lands_deep_ocean',
|
||||||
local biomemap = minetest.get_mapgen_object('biomemap')
|
can_run = function(biomemap)
|
||||||
local schem_positions = {}
|
return table.indexof(biomemap, biome_id_everness_cursed_lands_deep_ocean) ~= -1
|
||||||
local schem_placed = false
|
end,
|
||||||
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
shared_args.schem_positions = {}
|
||||||
|
local schem_placed = false
|
||||||
|
|
||||||
if table.indexof(biomemap, biome_id_everness_cursed_lands_deep_ocean) ~= -1 and rand:next(0, 100) < chance then
|
if rand:next(0, 100) < chance then
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
for y = maxp.y, minp.y, -1 do
|
||||||
local vm, emin, emax = minetest.get_mapgen_object('voxelmanip')
|
if schem_placed then
|
||||||
-- 'area' is used later to get the voxelmanip indexes for positions
|
break
|
||||||
local area = VoxelArea:new({ MinEdge = emin, MaxEdge = emax })
|
end
|
||||||
-- Get the content ID data from the voxelmanip in the form of a flat array.
|
|
||||||
-- Set the buffer parameter to use and reuse 'data' for this.
|
|
||||||
vm:get_data(data)
|
|
||||||
|
|
||||||
for y = maxp.y, minp.y, -1 do
|
for z = minp.z, maxp.z do
|
||||||
for z = minp.z, maxp.z do
|
if schem_placed then
|
||||||
for x = minp.x, maxp.x do
|
break
|
||||||
local vi = area:index(x, y, z)
|
end
|
||||||
|
|
||||||
if
|
for x = minp.x, maxp.x do
|
||||||
data[vi] == c_everness_cursed_lands_deep_ocean_sand
|
local vi = area:index(x, y, z)
|
||||||
and data[vi + area.ystride] == c_water_source
|
|
||||||
and not schem_placed
|
|
||||||
then
|
|
||||||
local s_pos = area:position(vi)
|
|
||||||
|
|
||||||
--
|
if
|
||||||
-- Cursed Lands Deep Ocean Skull
|
data[vi] == c_everness_cursed_lands_deep_ocean_sand
|
||||||
--
|
and data[vi + area.ystride] == c_water_source
|
||||||
|
then
|
||||||
|
local s_pos = area:position(vi)
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos)
|
--
|
||||||
|
-- Cursed Lands Deep Ocean Skull
|
||||||
|
--
|
||||||
|
|
||||||
-- find floor big enough
|
local schem_pos = vector.new(s_pos)
|
||||||
local indexes = Everness.find_content_in_vm_area(
|
|
||||||
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
|
||||||
{
|
|
||||||
c_everness_cursed_lands_deep_ocean_sand,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_plant_anemone,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_plant_darkilluma,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_plant_demon,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_alcyonacea,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_ostracod,
|
|
||||||
c_everness_cursed_lands_deep_ocean_coral_octocurse
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
area
|
|
||||||
)
|
|
||||||
|
|
||||||
if #indexes < size.x * size.z then
|
-- find floor big enough
|
||||||
-- not enough space
|
local indexes = Everness.find_content_in_vm_area(
|
||||||
return
|
vector.new(s_pos.x - size_x, s_pos.y - 1, s_pos.z - size_z),
|
||||||
end
|
vector.new(s_pos.x + size_x, s_pos.y + 1, s_pos.z + size_z),
|
||||||
|
{
|
||||||
-- enough water to place structure ?
|
c_everness_cursed_lands_deep_ocean_sand,
|
||||||
local water_indexes = Everness.find_content_in_vm_area(
|
c_everness_cursed_lands_deep_ocean_coral_plant_anemone,
|
||||||
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
c_everness_cursed_lands_deep_ocean_coral_plant_darkilluma,
|
||||||
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
c_everness_cursed_lands_deep_ocean_coral_plant_demon,
|
||||||
{
|
c_everness_cursed_lands_deep_ocean_coral_alcyonacea,
|
||||||
c_water_source
|
c_everness_cursed_lands_deep_ocean_coral_ostracod,
|
||||||
},
|
c_everness_cursed_lands_deep_ocean_coral_octocurse
|
||||||
data,
|
},
|
||||||
area
|
data,
|
||||||
)
|
area
|
||||||
|
|
||||||
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
schem_pos,
|
|
||||||
schem,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
schem_placed = true
|
if #indexes < size.x * size.z then
|
||||||
|
-- not enough space
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
schem_positions.everness_cursed_lands_deep_ocean_skull = schem_positions.everness_cursed_lands_deep_ocean_skull or {}
|
-- enough water to place structure ?
|
||||||
|
local water_indexes = Everness.find_content_in_vm_area(
|
||||||
|
vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z),
|
||||||
|
{
|
||||||
|
c_water_source
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
area
|
||||||
|
)
|
||||||
|
|
||||||
table.insert(schem_positions.everness_cursed_lands_deep_ocean_skull, {
|
if #water_indexes > (size.x * size.y * size.z) / 2 then
|
||||||
pos = schem_pos,
|
minetest.place_schematic_on_vmanip(
|
||||||
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
vm,
|
||||||
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
schem_pos,
|
||||||
})
|
schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Cursed Lands Deep Ocean Skull was placed at ' .. schem_pos:to_string())
|
schem_placed = true
|
||||||
|
|
||||||
|
shared_args.schem_positions.everness_cursed_lands_deep_ocean_skull = shared_args.schem_positions.everness_cursed_lands_deep_ocean_skull or {}
|
||||||
|
|
||||||
|
table.insert(shared_args.schem_positions.everness_cursed_lands_deep_ocean_skull, {
|
||||||
|
pos = schem_pos,
|
||||||
|
minp = vector.new(s_pos.x - size_x, s_pos.y, s_pos.z - size_z),
|
||||||
|
maxp = vector.new(s_pos.x + size_x, s_pos.y + size.y, s_pos.z + size_z)
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Cursed Lands Deep Ocean Skull was placed at ' .. schem_pos:to_string())
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
after_write_to_map = function(shared_args)
|
||||||
|
local schem_positions = shared_args.schem_positions or {}
|
||||||
|
|
||||||
-- Set the lighting within the `VoxelManip` to a uniform value
|
|
||||||
vm:set_lighting({ day = 0, night = 0 }, minp, maxp)
|
|
||||||
-- Calculate lighting for what has been created.
|
|
||||||
vm:calc_lighting()
|
|
||||||
-- Liquid nodes were placed so set them flowing.
|
|
||||||
vm:update_liquids()
|
|
||||||
-- Write what has been created to the world.
|
|
||||||
vm:write_to_map()
|
|
||||||
minetest.fix_light(minp, maxp)
|
|
||||||
|
|
||||||
-- Populate loot chests
|
|
||||||
for name, tbl in pairs(schem_positions) do
|
for name, tbl in pairs(schem_positions) do
|
||||||
if next(tbl) then
|
if next(tbl) then
|
||||||
for i, v in ipairs(tbl) do
|
for i, v in ipairs(tbl) do
|
||||||
|
@ -320,4 +314,4 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -219,6 +219,8 @@ Everness:register_decoration({
|
||||||
-- On Generated
|
-- On Generated
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local biome_id_everness_cursed_lands_under = minetest.get_biome_id('everness:cursed_lands_under')
|
||||||
|
|
||||||
local deco_id_cursed_lands_under_cursed_dream_tree = minetest.get_decoration_id('everness:cursed_lands_under_cursed_dream_tree')
|
local deco_id_cursed_lands_under_cursed_dream_tree = minetest.get_decoration_id('everness:cursed_lands_under_cursed_dream_tree')
|
||||||
|
|
||||||
local schem_cursed_dream_tree = minetest.get_modpath('everness') .. '/schematics/everness_cursed_dream_tree.mts'
|
local schem_cursed_dream_tree = minetest.get_modpath('everness') .. '/schematics/everness_cursed_dream_tree.mts'
|
||||||
|
@ -232,78 +234,79 @@ cursed_dream_tree_place_on = type(cursed_dream_tree_place_on) == 'string' and {
|
||||||
|
|
||||||
minetest.set_gen_notify({ decoration = true }, { deco_id_cursed_lands_under_cursed_dream_tree })
|
minetest.set_gen_notify({ decoration = true }, { deco_id_cursed_lands_under_cursed_dream_tree })
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
-- Load the voxelmanip with the result of engine mapgen
|
name = 'everness:cursed_lands_under',
|
||||||
local vm = minetest.get_mapgen_object('voxelmanip')
|
can_run = function(biomemap)
|
||||||
-- Returns a table mapping requested generation notification types to arrays of positions at which the corresponding generated structures are located within the current chunk
|
return table.indexof(biomemap, biome_id_everness_cursed_lands_under) ~= -1
|
||||||
local gennotify = minetest.get_mapgen_object('gennotify')
|
end,
|
||||||
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
--
|
||||||
|
-- Cursed Dream Tree
|
||||||
|
--
|
||||||
|
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_cursed_lands_under_cursed_dream_tree or '')] or {}) do
|
||||||
|
-- `pos` is position of the 'place_on' node
|
||||||
|
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||||
|
local marker_node = minetest.get_node(marker_pos)
|
||||||
|
local place_on_node = minetest.get_node(pos)
|
||||||
|
|
||||||
--
|
if not marker_node then
|
||||||
-- Cursed Dream Tree
|
return
|
||||||
--
|
end
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_cursed_lands_under_cursed_dream_tree or '')] or {}) do
|
|
||||||
-- `pos` is position of the 'place_on' node
|
|
||||||
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
|
||||||
local marker_node = minetest.get_node(marker_pos)
|
|
||||||
local place_on_node = minetest.get_node(pos)
|
|
||||||
|
|
||||||
if not marker_node then
|
if marker_node.name ~= 'everness:marker' then
|
||||||
return
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
end
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if marker_node.name ~= 'everness:marker' then
|
minetest.remove_node(marker_pos)
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.remove_node(marker_pos)
|
if table.indexof(cursed_dream_tree_place_on, place_on_node.name) == -1 then
|
||||||
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if table.indexof(cursed_dream_tree_place_on, place_on_node.name) == -1 then
|
-- no need to check for the floor "big enough" size since its a tree and has ~ 1x1 base size
|
||||||
-- not a valid "place_on" position (e.g. something else was placed there)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- no need to check for the floor "big enough" size since its a tree and has ~ 1x1 base size
|
-- enough air to place structure ?
|
||||||
|
local positions = minetest.find_nodes_in_area(
|
||||||
-- enough air to place structure ?
|
vector.new(
|
||||||
local positions = minetest.find_nodes_in_area(
|
pos.x - cursed_dream_tree_size_x,
|
||||||
vector.new(
|
pos.y - cursed_dream_tree_y_dis,
|
||||||
pos.x - cursed_dream_tree_size_x,
|
pos.z - cursed_dream_tree_size_z
|
||||||
pos.y - cursed_dream_tree_y_dis,
|
),
|
||||||
pos.z - cursed_dream_tree_size_z
|
vector.new(
|
||||||
),
|
pos.x + cursed_dream_tree_size_x,
|
||||||
vector.new(
|
pos.y - cursed_dream_tree_y_dis + cursed_dream_tree_size.y,
|
||||||
pos.x + cursed_dream_tree_size_x,
|
pos.z + cursed_dream_tree_size_z
|
||||||
pos.y - cursed_dream_tree_y_dis + cursed_dream_tree_size.y,
|
),
|
||||||
pos.z + cursed_dream_tree_size_z
|
{
|
||||||
),
|
'air',
|
||||||
{
|
'everness:dry_tree'
|
||||||
'air',
|
},
|
||||||
'everness:dry_tree'
|
true
|
||||||
},
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
local air = positions.air or {}
|
|
||||||
local tree = positions['everness:dry_tree'] or {}
|
|
||||||
|
|
||||||
if #tree > 1 then
|
|
||||||
-- will overlap another tree
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if #air > cursed_dream_tree_safe_volume then
|
|
||||||
minetest.place_schematic_on_vmanip(
|
|
||||||
vm,
|
|
||||||
vector.new(marker_pos.x, marker_pos.y - cursed_dream_tree_y_dis, marker_pos.z),
|
|
||||||
schem_cursed_dream_tree,
|
|
||||||
'random',
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
-- minetest.log('action', '[Everness] Cursed Dream Tree was placed at ' .. pos:to_string())
|
local air = positions.air or {}
|
||||||
|
local tree = positions['everness:dry_tree'] or {}
|
||||||
|
|
||||||
|
if #tree > 1 then
|
||||||
|
-- will overlap another tree
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if #air > cursed_dream_tree_safe_volume then
|
||||||
|
minetest.place_schematic_on_vmanip(
|
||||||
|
vm,
|
||||||
|
vector.new(marker_pos.x, marker_pos.y - cursed_dream_tree_y_dis, marker_pos.z),
|
||||||
|
schem_cursed_dream_tree,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
-- minetest.log('action', '[Everness] Cursed Dream Tree was placed at ' .. pos:to_string())
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -155,6 +155,33 @@ Everness:register_decoration({
|
||||||
flags = 'all_floors'
|
flags = 'all_floors'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Everness:register_decoration({
|
||||||
|
name = 'everness:forsaken_tundra_under_willow_tree',
|
||||||
|
deco_type = 'simple',
|
||||||
|
place_on = {
|
||||||
|
'everness:mold_stone_with_moss',
|
||||||
|
'everness:blue_crying_obsidian',
|
||||||
|
'everness:blue_weeping_obsidian',
|
||||||
|
'everness:weeping_obsidian'
|
||||||
|
},
|
||||||
|
sidelen = 16,
|
||||||
|
noise_params = {
|
||||||
|
offset = 0,
|
||||||
|
scale = 0.002,
|
||||||
|
spread = { x = 250, y = 250, z = 250 },
|
||||||
|
seed = 2,
|
||||||
|
octaves = 3,
|
||||||
|
persist = 0.66
|
||||||
|
},
|
||||||
|
biomes = { 'everness:forsaken_tundra_under' },
|
||||||
|
y_max = y_max - 1500 > y_min and y_max - 1500 or y_max,
|
||||||
|
y_min = y_min,
|
||||||
|
flags = 'all_floors',
|
||||||
|
decoration = {
|
||||||
|
'everness:marker'
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
Everness:register_decoration({
|
Everness:register_decoration({
|
||||||
name = 'everness:forsaken_tundra_under_bloodspore_plant_small',
|
name = 'everness:forsaken_tundra_under_bloodspore_plant_small',
|
||||||
deco_type = 'simple',
|
deco_type = 'simple',
|
||||||
|
@ -250,84 +277,95 @@ register_agave_leaf_decoration(0, 0.06, 1)
|
||||||
-- On Generated
|
-- On Generated
|
||||||
--
|
--
|
||||||
|
|
||||||
local c_air = minetest.get_content_id('air')
|
local biome_id_everness_forsaken_tundra_under = minetest.get_biome_id('everness:forsaken_tundra_under')
|
||||||
local c_mold_stone_with_moss = minetest.get_content_id('everness:mold_stone_with_moss')
|
|
||||||
|
|
||||||
-- Localize data buffer table outside the loop, to be re-used for all
|
local deco_id_everness_forsaken_tundra_under_willow_tree = minetest.get_decoration_id('everness:forsaken_tundra_under_willow_tree')
|
||||||
-- mapchunks, therefore minimising memory use.
|
|
||||||
local data = {}
|
|
||||||
local chance = 50
|
|
||||||
local disp = 16
|
|
||||||
local rotations = { '0', '90', '180', '270' }
|
|
||||||
local everness_forsaken_tundra_under_y_max = y_max - 1500 > y_min and y_max - 1500 or y_max
|
|
||||||
local everness_forsaken_tundra_under_y_min = y_min
|
|
||||||
|
|
||||||
-- size = { x = 39, y = 28, z = 39 }
|
|
||||||
local willow_tree_volume = 39 * 39 * 28
|
|
||||||
local willow_tree_schem = minetest.get_modpath('everness') .. '/schematics/everness_willow_tree.mts'
|
local willow_tree_schem = minetest.get_modpath('everness') .. '/schematics/everness_willow_tree.mts'
|
||||||
|
local size = { x = 39, y = 28, z = 39 }
|
||||||
|
local size_x = math.round(size.x / 2)
|
||||||
|
local size_z = math.round(size.z / 2)
|
||||||
|
local safe_volume = (size.x * size.y * size.z) / 1.5
|
||||||
|
local y_dis = 1
|
||||||
|
local willow_tree_place_on = minetest.registered_decorations['everness:forsaken_tundra_under_willow_tree'].place_on
|
||||||
|
willow_tree_place_on = type(willow_tree_place_on) == 'string' and { willow_tree_place_on } or willow_tree_place_on
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
minetest.set_gen_notify({ decoration = true }, { deco_id_everness_forsaken_tundra_under_willow_tree })
|
||||||
local rand = PcgRandom(blockseed)
|
|
||||||
|
|
||||||
local vm, emin, emax = minetest.get_mapgen_object('voxelmanip')
|
Everness:add_to_queue_on_generated({
|
||||||
local area = VoxelArea:new({ MinEdge = emin, MaxEdge = emax })
|
name = 'everness:forsaken_tundra_under',
|
||||||
-- Get the content ID data from the voxelmanip in the form of a flat array.
|
can_run = function(biomemap)
|
||||||
-- Set the buffer parameter to use and reuse 'data' for this.
|
return table.indexof(biomemap, biome_id_everness_forsaken_tundra_under) ~= -1
|
||||||
vm:get_data(data)
|
end,
|
||||||
local sidelength = maxp.x - minp.x + 1
|
after_set_data = function(minp, maxp, vm, area, data, p2data, gennotify, rand, shared_args)
|
||||||
|
--
|
||||||
|
-- Willow Tree
|
||||||
|
--
|
||||||
|
|
||||||
local x_disp = rand:next(0, disp)
|
for _, pos in ipairs(gennotify['decoration#' .. (deco_id_everness_forsaken_tundra_under_willow_tree or '')] or {}) do
|
||||||
local z_disp = rand:next(0, disp)
|
-- `pos` is position of the 'place_on' node
|
||||||
|
local marker_pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||||
|
local marker_node = minetest.get_node(marker_pos)
|
||||||
|
local place_on_node = minetest.get_node(pos)
|
||||||
|
|
||||||
if everness_forsaken_tundra_under_y_min < maxp.y
|
if not marker_node then
|
||||||
and maxp.y < everness_forsaken_tundra_under_y_max
|
return
|
||||||
then
|
end
|
||||||
for y = minp.y, maxp.y do
|
|
||||||
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)
|
|
||||||
|
|
||||||
if data[vi + area.ystride] == c_air and data[vi] == c_mold_stone_with_moss then
|
if marker_node.name ~= 'everness:marker' then
|
||||||
local rotation = rotations[rand:next(1, #rotations)]
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
local s_pos = area:position(vi)
|
return
|
||||||
local biome_data = minetest.get_biome_data(s_pos)
|
end
|
||||||
|
|
||||||
if not biome_data then
|
minetest.remove_node(marker_pos)
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local biome_name = minetest.get_biome_name(biome_data.biome)
|
if table.indexof(willow_tree_place_on, place_on_node.name) == -1 then
|
||||||
|
-- not a valid "place_on" position (e.g. something else was placed there)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if not biome_name then
|
-- no need to check for the floor "big enough" size since its a tree and has ~ 1x1 base size
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if biome_name == 'everness:forsaken_tundra_under' and rand:next(0, 100) < chance then
|
-- enough air to place structure ?
|
||||||
--
|
local positions = minetest.find_nodes_in_area(
|
||||||
-- Willow Tree
|
vector.new(
|
||||||
--
|
pos.x - size_x,
|
||||||
|
pos.y - y_dis,
|
||||||
|
pos.z - size_z
|
||||||
|
),
|
||||||
|
vector.new(
|
||||||
|
pos.x + size_x,
|
||||||
|
pos.y - y_dis + size.y,
|
||||||
|
pos.z + size_z
|
||||||
|
),
|
||||||
|
{
|
||||||
|
'air',
|
||||||
|
'everness:willow_tree'
|
||||||
|
},
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
local schem_pos = vector.new(s_pos.x, s_pos.y, s_pos.z)
|
local air = positions.air or {}
|
||||||
local air_positions = minetest.find_nodes_in_area(
|
local tree = positions['everness:willow_tree'] or {}
|
||||||
vector.new(s_pos.x - 19, s_pos.y, s_pos.z - 19),
|
|
||||||
vector.new(s_pos.x + 19, s_pos.y + 28, s_pos.z + 19),
|
|
||||||
{'air'},
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
if air_positions.air and #air_positions.air > (willow_tree_volume / 2) then
|
if #tree > 1 then
|
||||||
minetest.place_schematic_on_vmanip(
|
-- will overlap another tree
|
||||||
vm,
|
return
|
||||||
schem_pos,
|
end
|
||||||
willow_tree_schem,
|
|
||||||
rotation,
|
|
||||||
nil,
|
|
||||||
true,
|
|
||||||
'place_center_x, place_center_z'
|
|
||||||
)
|
|
||||||
|
|
||||||
minetest.log('action', '[Everness] Willow Tree was placed at ' .. schem_pos:to_string())
|
if #air > safe_volume then
|
||||||
end
|
minetest.place_schematic_on_vmanip(
|
||||||
end
|
vm,
|
||||||
|
vector.new(marker_pos.x, marker_pos.y - y_dis, marker_pos.z),
|
||||||
|
willow_tree_schem,
|
||||||
|
'random',
|
||||||
|
nil,
|
||||||
|
true,
|
||||||
|
'place_center_x, place_center_z'
|
||||||
|
)
|
||||||
|
|
||||||
|
minetest.log('action', '[Everness] Willow Tree was placed at ' .. pos:to_string())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
})
|
||||||
|
|
|
@ -313,9 +313,18 @@ Everness:register_decoration({
|
||||||
-- On Generated
|
-- On Generated
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local size_ceiling = { x = 2, y = 19, z = 2 }
|
||||||
|
local size_ceiling_x = math.round(size_ceiling.x / 2)
|
||||||
|
local size_ceiling_z = math.round(size_ceiling.z / 2)
|
||||||
|
local size_floor = { x = 2, y = 20, z = 2 }
|
||||||
|
local size_floor_x = math.round(size_floor.x / 2)
|
||||||
|
local size_floor_z = math.round(size_floor.z / 2)
|
||||||
|
|
||||||
local deco_id_frosted_icicle_large_ceiling = minetest.get_decoration_id('everness:frosted_icicle_large_ceiling')
|
local deco_id_frosted_icicle_large_ceiling = minetest.get_decoration_id('everness:frosted_icicle_large_ceiling')
|
||||||
local deco_id_frosted_icicle_large_floor = minetest.get_decoration_id('everness:frosted_icicle_large_floor')
|
local deco_id_frosted_icicle_large_floor = minetest.get_decoration_id('everness:frosted_icicle_large_floor')
|
||||||
|
|
||||||
|
local biome_id_everness_frosted_icesheet_under = minetest.get_biome_id('everness:frosted_icesheet_under')
|
||||||
|
|
||||||
minetest.set_gen_notify(
|
minetest.set_gen_notify(
|
||||||
{ decoration = true },
|
{ decoration = true },
|
||||||
{
|
{
|
||||||
|
@ -324,75 +333,73 @@ minetest.set_gen_notify(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
Everness:add_to_queue_on_generated({
|
||||||
local gennotify = minetest.get_mapgen_object('gennotify')
|
name = 'everness:frosted_icesheet_under',
|
||||||
local size_ceiling = { x = 2, y = 19, z = 2 }
|
can_run = function(biomemap)
|
||||||
local size_ceiling_x = math.round(size_ceiling.x / 2)
|
return table.indexof(biomemap, biome_id_everness_frosted_icesheet_under) ~= -1
|
||||||
local size_ceiling_z = math.round(size_ceiling.z / 2)
|
end,
|
||||||
local size_floor = { x = 2, y = 20, z = 2 }
|
after_write_to_map = function(shared_args, gennotify)
|
||||||
local size_floor_x = math.round(size_floor.x / 2)
|
--
|
||||||
local size_floor_z = math.round(size_floor.z / 2)
|
-- Frosted Large Icicle Ceiling
|
||||||
|
--
|
||||||
--
|
for _, pos in ipairs(gennotify['decoration#' .. deco_id_frosted_icicle_large_ceiling] or {}) do
|
||||||
-- Frosted Large Icicle Ceiling
|
local markers = minetest.find_nodes_in_area(
|
||||||
--
|
vector.new(pos.x - size_ceiling_x, pos.y - size_ceiling.y + 2, pos.z - size_ceiling_z),
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. deco_id_frosted_icicle_large_ceiling] or {}) do
|
vector.new(pos.x + size_ceiling_x, pos.y - size_ceiling.y, pos.z + size_ceiling_z),
|
||||||
local markers = minetest.find_nodes_in_area(
|
{ 'everness:marker' }
|
||||||
vector.new(pos.x - size_ceiling_x, pos.y - size_ceiling.y + 2, pos.z - size_ceiling_z),
|
|
||||||
vector.new(pos.x + size_ceiling_x, pos.y - size_ceiling.y, pos.z + size_ceiling_z),
|
|
||||||
{ 'everness:marker' }
|
|
||||||
)
|
|
||||||
|
|
||||||
if #markers > 0 then
|
|
||||||
local pos_marker = markers[1]
|
|
||||||
local air_below = minetest.find_nodes_in_area(
|
|
||||||
vector.new(pos_marker.x, pos_marker.y, pos_marker.z),
|
|
||||||
vector.new(pos_marker.x, pos_marker.y - 7, pos_marker.z),
|
|
||||||
{'air'}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Replace marker
|
if #markers > 0 then
|
||||||
minetest.set_node(pos_marker, { name = 'everness:frosted_cave_ice_illuminating' })
|
local pos_marker = markers[1]
|
||||||
|
local air_below = minetest.find_nodes_in_area(
|
||||||
|
vector.new(pos_marker.x, pos_marker.y, pos_marker.z),
|
||||||
|
vector.new(pos_marker.x, pos_marker.y - 7, pos_marker.z),
|
||||||
|
{'air'}
|
||||||
|
)
|
||||||
|
|
||||||
if #air_below == 7 then
|
-- Replace marker
|
||||||
local incrementer = 1
|
minetest.set_node(pos_marker, { name = 'everness:frosted_cave_ice_illuminating' })
|
||||||
local pos_below = vector.new(pos_marker.x, pos_marker.y - incrementer, pos_marker.z)
|
|
||||||
local node_below = minetest.get_node(pos_below)
|
|
||||||
|
|
||||||
Everness.stack_icicle_recursive(node_below, pos_below, incrementer, pos_marker, 'down')
|
if #air_below == 7 then
|
||||||
|
local incrementer = 1
|
||||||
|
local pos_below = vector.new(pos_marker.x, pos_marker.y - incrementer, pos_marker.z)
|
||||||
|
local node_below = minetest.get_node(pos_below)
|
||||||
|
|
||||||
|
Everness.stack_icicle_recursive(node_below, pos_below, incrementer, pos_marker, 'down')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Frosted Large Icicle Floor
|
||||||
|
--
|
||||||
|
for _, pos in ipairs(gennotify['decoration#' .. deco_id_frosted_icicle_large_floor] or {}) do
|
||||||
|
local markers = minetest.find_nodes_in_area(
|
||||||
|
vector.new(pos.x - size_floor_x, pos.y + size_floor.y - 2, pos.z - size_floor_z),
|
||||||
|
vector.new(pos.x + size_floor_x, pos.y + size_floor.y, pos.z + size_floor_z),
|
||||||
|
{ 'everness:marker' }
|
||||||
|
)
|
||||||
|
|
||||||
|
if #markers > 0 then
|
||||||
|
local pos_marker = markers[1]
|
||||||
|
local air_above = minetest.find_nodes_in_area(
|
||||||
|
vector.new(pos_marker.x, pos_marker.y, pos_marker.z),
|
||||||
|
vector.new(pos_marker.x, pos_marker.y + 7, pos_marker.z),
|
||||||
|
{'air'}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Replace marker
|
||||||
|
minetest.set_node(pos_marker, { name = 'everness:frosted_cave_ice_illuminating' })
|
||||||
|
|
||||||
|
-- Make sure we have some space
|
||||||
|
if #air_above == 7 then
|
||||||
|
local incrementer = 1
|
||||||
|
local pos_above = vector.new(pos_marker.x, pos_marker.y + incrementer, pos_marker.z)
|
||||||
|
local node_above = minetest.get_node(pos_above)
|
||||||
|
|
||||||
|
Everness.stack_icicle_recursive(node_above, pos_above, incrementer, pos_marker, 'up')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
})
|
||||||
--
|
|
||||||
-- Frosted Large Icicle Floor
|
|
||||||
--
|
|
||||||
for _, pos in ipairs(gennotify['decoration#' .. deco_id_frosted_icicle_large_floor] or {}) do
|
|
||||||
local markers = minetest.find_nodes_in_area(
|
|
||||||
vector.new(pos.x - size_floor_x, pos.y + size_floor.y - 2, pos.z - size_floor_z),
|
|
||||||
vector.new(pos.x + size_floor_x, pos.y + size_floor.y, pos.z + size_floor_z),
|
|
||||||
{ 'everness:marker' }
|
|
||||||
)
|
|
||||||
|
|
||||||
if #markers > 0 then
|
|
||||||
local pos_marker = markers[1]
|
|
||||||
local air_above = minetest.find_nodes_in_area(
|
|
||||||
vector.new(pos_marker.x, pos_marker.y, pos_marker.z),
|
|
||||||
vector.new(pos_marker.x, pos_marker.y + 7, pos_marker.z),
|
|
||||||
{'air'}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Replace marker
|
|
||||||
minetest.set_node(pos_marker, { name = 'everness:frosted_cave_ice_illuminating' })
|
|
||||||
|
|
||||||
-- Make sure we have some space
|
|
||||||
if #air_above == 7 then
|
|
||||||
local incrementer = 1
|
|
||||||
local pos_above = vector.new(pos_marker.x, pos_marker.y + incrementer, pos_marker.z)
|
|
||||||
local node_above = minetest.get_node(pos_above)
|
|
||||||
|
|
||||||
Everness.stack_icicle_recursive(node_above, pos_above, incrementer, pos_marker, 'up')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
Binary file not shown.
Ŝarĝante…
Reference in New Issue