2018-07-17 21:16:37 +02:00
|
|
|
multi_map = {}
|
|
|
|
|
2018-07-22 18:28:23 +02:00
|
|
|
-- Shorthand alias, can be used when no mods are installed called mm or creating global mm
|
|
|
|
if not mm then
|
|
|
|
mm = multi_map
|
|
|
|
end
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
multi_map.number_of_layers = 24 -- How may layers to generate
|
2018-07-22 23:48:46 +02:00
|
|
|
multi_map.layers_start_chunk = 0 -- Y level where to start generating layers, in chunks
|
2018-07-21 12:20:46 +02:00
|
|
|
multi_map.layer_height_chunks = 32 -- Height of each layer, in chunks
|
|
|
|
|
|
|
|
-- Either engine defaults or derived from above values
|
2018-07-17 21:16:37 +02:00
|
|
|
multi_map.layer_height = multi_map.layer_height_chunks * 80
|
2018-07-22 23:48:46 +02:00
|
|
|
multi_map.layers_start = multi_map.layers_start_chunk * 80
|
2018-07-17 21:16:37 +02:00
|
|
|
multi_map.map_height = 61840
|
|
|
|
multi_map.map_min = -30912
|
|
|
|
multi_map.map_max = 30927
|
|
|
|
multi_map.half_layer_height = multi_map.layer_height / 2
|
|
|
|
multi_map.current_layer = nil
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Can be overridden with someone's own values
|
2018-07-17 22:59:58 +02:00
|
|
|
multi_map.bedrock = "multi_map_core:bedrock"
|
|
|
|
multi_map.skyrock = "multi_map_core:skyrock"
|
2018-07-17 21:16:37 +02:00
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Whether to generate a bedrock layer under a layer/ skyrock above a layer
|
2018-07-17 21:16:37 +02:00
|
|
|
multi_map.generate_bedrock = true
|
|
|
|
multi_map.generate_skyrock = true
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Chain of generators
|
2018-07-17 21:16:37 +02:00
|
|
|
multi_map.generators = {}
|
2018-07-21 12:20:46 +02:00
|
|
|
-- When no suitable generator is found, this generator is used as a fallback
|
2018-07-18 23:22:18 +02:00
|
|
|
multi_map.fallback_generator = nil
|
2018-07-17 21:16:37 +02:00
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Set the current layer which the mapgen is generating
|
|
|
|
-- y = absolute y value to be translated to layer
|
2018-07-17 21:16:37 +02:00
|
|
|
function multi_map.set_current_layer(y)
|
|
|
|
for l = 0, multi_map.number_of_layers do
|
2018-07-22 23:48:46 +02:00
|
|
|
if y >= multi_map.map_min + multi_map.layers_start + (l * multi_map.layer_height)
|
|
|
|
and y < multi_map.map_min + multi_map.layers_start + ((l + 1) * multi_map.layer_height)
|
2018-07-17 21:16:37 +02:00
|
|
|
then
|
|
|
|
multi_map.current_layer = l
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-22 03:33:51 +02:00
|
|
|
function multi_map.get_absolute_centerpoint(current_layer)
|
|
|
|
if current_layer then
|
2018-07-22 23:48:46 +02:00
|
|
|
return multi_map.map_min + multi_map.layers_start + (current_layer * multi_map.layer_height) + multi_map.half_layer_height
|
2018-07-22 03:33:51 +02:00
|
|
|
else
|
2018-07-22 23:48:46 +02:00
|
|
|
return multi_map.map_min + multi_map.layers_start + (multi_map.current_layer * multi_map.layer_height) + multi_map.half_layer_height
|
2018-07-22 03:33:51 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Get the offset y position, i.e. the y relative to the current layer's center point
|
|
|
|
-- y = absolute y value to be translated to y relative to layer center point
|
2018-07-17 21:16:37 +02:00
|
|
|
function multi_map.get_offset_y(y)
|
2018-07-22 23:48:46 +02:00
|
|
|
local center_point = multi_map.map_min + multi_map.layers_start + (multi_map.current_layer * multi_map.layer_height) + multi_map.half_layer_height
|
2018-07-21 12:20:46 +02:00
|
|
|
|
|
|
|
if center_point > 0 and y > 0 then
|
|
|
|
return math.abs(y) - math.abs(center_point)
|
|
|
|
elseif center_point < 0 and y < 0 then
|
|
|
|
return math.abs(center_point) - math.abs(y)
|
2018-07-22 17:03:13 +02:00
|
|
|
elseif center_point > 0 and y < 0 then
|
|
|
|
return math.abs(y) - math.abs(center_point)
|
2018-07-21 12:20:46 +02:00
|
|
|
else
|
|
|
|
return center_point - y
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Get the absolute y position from a relative offset position
|
|
|
|
-- layer = the layer we are in
|
|
|
|
-- y = relative y value to be translated to absolute world y position
|
|
|
|
function multi_map.get_absolute_y(layer, y)
|
2018-07-22 23:48:46 +02:00
|
|
|
local center_point = multi_map.map_min + multi_map.layers_start + (multi_map.current_layer * multi_map.layer_height) + multi_map.half_layer_height
|
2018-07-17 21:16:37 +02:00
|
|
|
return y - center_point
|
|
|
|
end
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Register a fallback generator, which is called in case not suitable generators are found for a layer
|
|
|
|
-- generator = the function to call
|
|
|
|
-- arguments = optional value or table with values that will be passed to the generator when called
|
2018-07-19 00:11:59 +02:00
|
|
|
function multi_map.register_fallback_generator(...)
|
|
|
|
local arg = {...}
|
|
|
|
local generator
|
|
|
|
local arguments
|
|
|
|
|
|
|
|
if arg[2] then
|
|
|
|
generator = arg[1]
|
|
|
|
arguments = arg[2]
|
|
|
|
else
|
|
|
|
generator = arg[1]
|
|
|
|
end
|
|
|
|
multi_map.fallback_generator = { generator = generator, arguments = arguments }
|
2018-07-18 23:22:18 +02:00
|
|
|
end
|
|
|
|
|
2018-07-23 20:46:26 +02:00
|
|
|
local last_used_layer = -1
|
|
|
|
|
2018-07-23 01:04:07 +02:00
|
|
|
multi_map.global_2d_maps = {}
|
|
|
|
multi_map.global_2d_params = {}
|
|
|
|
multi_map.global_2d_map_arrays = {}
|
|
|
|
|
2018-07-23 20:46:26 +02:00
|
|
|
local map_cache = {}
|
2018-07-23 01:04:07 +02:00
|
|
|
|
|
|
|
function multi_map.register_global_2dmap(name, params)
|
|
|
|
math.randomseed(params.seed)
|
|
|
|
multi_map.global_2d_params[name] = {}
|
|
|
|
multi_map.global_2d_map_arrays[name] = {}
|
|
|
|
|
|
|
|
for i = 0, multi_map.number_of_layers -1 do
|
|
|
|
local new_params = {
|
|
|
|
offset = params.offset,
|
|
|
|
scale = params.scale,
|
|
|
|
spread = {x=params.spread.x, y=params.spread.y, z=params.spread.z},
|
|
|
|
seed = math.random(-1000000000000, 1000000000000),
|
|
|
|
octaves = params.octaves,
|
|
|
|
persist = params.persist
|
|
|
|
}
|
|
|
|
multi_map.global_2d_params[name][i] = new_params
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function multi_map.get_global_2dmap_flat(name, chulenxz, minposxz, current_layer)
|
2018-07-23 20:46:26 +02:00
|
|
|
if not multi_map.global_2d_map_arrays[name] then
|
|
|
|
minetest.log("error", "[multi_map] Trying to get an unregistered global 2D map")
|
|
|
|
end
|
|
|
|
|
|
|
|
if not map_cache[name] then
|
|
|
|
if not current_layer then
|
|
|
|
if multi_map.current_layer ~= last_used_layer then
|
|
|
|
multi_map.global_2d_maps[name] = minetest.get_perlin_map(multi_map.global_2d_params[name][multi_map.current_layer], chulenxz)
|
|
|
|
end
|
|
|
|
map_cache[name] = multi_map.global_2d_maps[name]:get2dMap_flat(minposxz, multi_map.global_2d_map_arrays[name][multi_map.current_layer])
|
|
|
|
return map_cache[name]
|
|
|
|
else
|
|
|
|
if current_layer ~= last_used_layer then
|
|
|
|
multi_map.global_2d_maps[name] = minetest.get_perlin_map(multi_map.global_2d_params[name][current_layer], chulenxz)
|
|
|
|
end
|
|
|
|
map_cache[name] = multi_map.global_2d_maps[name]:get2dMap_flat(minposxz, multi_map.global_2d_map_arrays[name][current_layer])
|
2018-07-23 01:04:07 +02:00
|
|
|
end
|
|
|
|
end
|
2018-07-23 20:46:26 +02:00
|
|
|
|
|
|
|
return map_cache[name]
|
2018-07-23 01:04:07 +02:00
|
|
|
end
|
|
|
|
|
2018-07-23 20:46:26 +02:00
|
|
|
multi_map.global_3d_maps = {}
|
|
|
|
multi_map.global_3d_params = {}
|
|
|
|
multi_map.global_3d_map_arrays = {}
|
|
|
|
|
|
|
|
function multi_map.register_global_3dmap(name, params)
|
|
|
|
multi_map.global_3d_params[name] = params
|
|
|
|
multi_map.global_3d_map_arrays[name] = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
function multi_map.get_global_3dmap_flat(name, chulenxyz, minposxyz)
|
|
|
|
if not multi_map.global_3d_map_arrays[name] then
|
|
|
|
minetest.log("error", "[multi_map] Trying to get an unregistered global 3D map")
|
|
|
|
end
|
|
|
|
|
|
|
|
if not map_cache[name] then
|
|
|
|
if not multi_map.global_3d_maps[name] then
|
|
|
|
multi_map.global_3d_maps[name] = minetest.get_perlin_map(multi_map.global_3d_params[name], chulenxyz)
|
|
|
|
end
|
|
|
|
map_cache[name] = multi_map.global_3d_maps[name]:get3dMap_flat(minposxyz, multi_map.global_3d_map_arrays[name])
|
|
|
|
end
|
|
|
|
|
|
|
|
return map_cache[name]
|
2018-07-23 01:04:07 +02:00
|
|
|
end
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Register a generator for all if position is left out or one layer if position is specified
|
|
|
|
-- position = the optional layer for which call this generator
|
|
|
|
-- generator = the function to call
|
|
|
|
-- arguments = optional value or table with values that will be passed to the generator when called
|
2018-07-18 23:22:18 +02:00
|
|
|
function multi_map.register_generator(...)
|
|
|
|
local arg = {...}
|
|
|
|
local position
|
|
|
|
local generator
|
2018-07-19 00:11:59 +02:00
|
|
|
local arguments
|
2018-07-18 23:22:18 +02:00
|
|
|
|
2018-07-19 00:11:59 +02:00
|
|
|
if arg[3] then
|
2018-07-18 23:22:18 +02:00
|
|
|
position = arg[1]
|
|
|
|
generator = arg[2]
|
2018-07-19 00:11:59 +02:00
|
|
|
arguments = arg[3]
|
|
|
|
elseif arg[2] then
|
|
|
|
if type(arg[1]) == "function" then
|
|
|
|
generator = arg[1]
|
|
|
|
arguments = arg[2]
|
|
|
|
else
|
|
|
|
position = arg[1]
|
|
|
|
generator = arg[2]
|
|
|
|
end
|
2018-07-18 23:22:18 +02:00
|
|
|
else
|
|
|
|
generator = arg[1]
|
|
|
|
end
|
|
|
|
|
|
|
|
if not position then
|
|
|
|
for i = 0, multi_map.number_of_layers - 1 do
|
|
|
|
local t = multi_map.generators[i]
|
|
|
|
if not t then
|
|
|
|
t = {}
|
|
|
|
multi_map.generators[i] = t
|
|
|
|
end
|
2018-07-19 00:11:59 +02:00
|
|
|
table.insert(t, { generator = generator, arguments = arguments })
|
2018-07-18 23:22:18 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
local t = multi_map.generators[position]
|
|
|
|
if not t then
|
|
|
|
t = {}
|
|
|
|
multi_map.generators[position] = t
|
|
|
|
end
|
2018-07-19 00:11:59 +02:00
|
|
|
table.insert(t, { generator = generator, arguments = arguments })
|
2018-07-18 23:22:18 +02:00
|
|
|
end
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|
|
|
|
|
2018-07-21 12:20:46 +02:00
|
|
|
-- Helper to fill a chunk with a single type of node
|
2018-07-17 22:59:58 +02:00
|
|
|
function multi_map.generate_singlenode_chunk(minp, maxp, area, vm_data, content_id)
|
2018-07-17 21:16:37 +02:00
|
|
|
for z = minp.z, maxp.z do
|
|
|
|
for y = minp.y, maxp.y do
|
|
|
|
local vi = area:index(minp.x, y, z)
|
|
|
|
for x = minp.x, maxp.x do
|
|
|
|
vm_data[vi] = content_id
|
|
|
|
vi = vi + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-22 14:24:43 +02:00
|
|
|
-- Helper to create a 1 node high plane on the specified y
|
|
|
|
function multi_map.generate_singlenode_plane(minp, maxp, area, vm_data, y, content_id)
|
|
|
|
for z = minp.z, maxp.z do
|
|
|
|
local vi = area:index(minp.x, y, z)
|
|
|
|
for x = minp.x, maxp.x do
|
|
|
|
vm_data[vi] = content_id
|
|
|
|
vi = vi + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-22 18:28:23 +02:00
|
|
|
-- Inspired by duane's underworlds, to fetch the result of get_content_id once and cache it
|
|
|
|
multi_map.node = setmetatable({}, {
|
|
|
|
__index = function(t, k)
|
|
|
|
if not (t and k and type(t) == 'table') then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
t[k] = minetest.get_content_id(k)
|
|
|
|
return t[k]
|
|
|
|
end
|
|
|
|
})
|
2018-07-17 21:16:37 +02:00
|
|
|
|
|
|
|
minetest.register_on_mapgen_init(function(mapgen_params)
|
2018-07-22 23:48:46 +02:00
|
|
|
if multi_map.layers_start + (multi_map.number_of_layers * multi_map.layer_height) > multi_map.map_height then
|
2018-07-23 20:46:26 +02:00
|
|
|
minetest.log("error", "[multi_map] Number of layers for the given layer height exceeds map height!")
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|
2018-07-22 17:03:13 +02:00
|
|
|
minetest.set_mapgen_params({mgname="singlenode"})
|
2018-07-17 21:16:37 +02:00
|
|
|
end)
|
|
|
|
|
2018-07-23 20:46:26 +02:00
|
|
|
function multi_map.log_state()
|
|
|
|
minetest.log("action", "[multi_map] Multiple map layer generator global settings")
|
|
|
|
minetest.log("action", "[multi_map] - Number of layers: "..multi_map.number_of_layers)
|
|
|
|
minetest.log("action", "[multi_map] - Layers start at: "..(multi_map.map_min + multi_map.layers_start))
|
|
|
|
minetest.log("action", "[multi_map] - Layer height: "..multi_map.layer_height)
|
|
|
|
|
|
|
|
minetest.log("action", "[multi_map]")
|
|
|
|
minetest.log("action", "[multi_map] Registered generators")
|
|
|
|
if multi_map.fallback_generator then
|
|
|
|
minetest.log("action", "[multi_map] - "..debug.getinfo(multi_map.fallback_generator.generator).short_src:match("^.+/(.+)$").." (fallback)")
|
|
|
|
end
|
|
|
|
for k,v in pairs(multi_map.generators) do
|
|
|
|
for l,b in pairs(multi_map.generators[k]) do
|
|
|
|
minetest.log("action", "[multi_map] - "..debug.getinfo(b.generator).short_src:match("^.+/(.+)$").." (layer "..k..")")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.log("action", "[multi_map]")
|
|
|
|
minetest.log("action", "[multi_map] Registered global maps")
|
|
|
|
for k,v in pairs(multi_map.global_2d_params) do
|
|
|
|
minetest.log("action", "[multi_map] - "..k.." (2D)")
|
|
|
|
end
|
|
|
|
for k,v in pairs(multi_map.global_3d_params) do
|
|
|
|
minetest.log("action", "[multi_map] - "..k.." (3D)")
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.log("action", "[multi_map]")
|
|
|
|
end
|
|
|
|
|
|
|
|
local firstrun = true
|
|
|
|
|
2018-07-17 21:16:37 +02:00
|
|
|
minetest.register_on_generated(function(minp, maxp)
|
2018-07-23 20:46:26 +02:00
|
|
|
if firstrun then
|
|
|
|
minetest.log("action", "[multi_map]")
|
|
|
|
minetest.log("action", "[multi_map] First on_generated call started, module state:")
|
|
|
|
minetest.log("action", "[multi_map]")
|
|
|
|
multi_map.log_state()
|
|
|
|
firstrun = false
|
|
|
|
end
|
|
|
|
|
2018-07-17 21:16:37 +02:00
|
|
|
multi_map.set_current_layer(minp.y)
|
|
|
|
local sidelen = maxp.x - minp.x + 1
|
|
|
|
|
2018-07-17 23:35:05 +02:00
|
|
|
if multi_map.current_layer >= multi_map.number_of_layers then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2018-07-17 21:16:37 +02:00
|
|
|
local offset_minp = { x = minp.x, y = multi_map.get_offset_y(minp.y), z = minp.z }
|
|
|
|
local offset_maxp = { x = maxp.x, y = multi_map.get_offset_y(maxp.y), z = maxp.z }
|
|
|
|
|
|
|
|
if multi_map.generate_bedrock and
|
2018-07-22 23:48:46 +02:00
|
|
|
multi_map.map_min + multi_map.layers_start + (multi_map.layer_height * multi_map.current_layer) == minp.y
|
2018-07-17 21:16:37 +02:00
|
|
|
then
|
|
|
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
|
|
|
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
|
|
|
|
local vm_data = vm:get_data()
|
|
|
|
|
2018-07-22 18:28:23 +02:00
|
|
|
multi_map.generate_singlenode_chunk(minp, maxp, area, vm_data, multi_map.node[multi_map.bedrock])
|
2018-07-22 14:24:43 +02:00
|
|
|
|
2018-07-17 21:16:37 +02:00
|
|
|
vm:set_data(vm_data)
|
|
|
|
vm:calc_lighting(false)
|
|
|
|
vm:write_to_map(false)
|
|
|
|
elseif multi_map.generate_skyrock
|
2018-07-22 23:48:46 +02:00
|
|
|
and (multi_map.map_min + multi_map.layers_start + (multi_map.layer_height * (multi_map.current_layer + 1)) - 80 == minp.y or
|
|
|
|
multi_map.map_min + multi_map.layers_start + (multi_map.layer_height * (multi_map.current_layer + 1)) - 160 == minp.y
|
2018-07-17 21:16:37 +02:00
|
|
|
)
|
|
|
|
then
|
|
|
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
|
|
|
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
|
|
|
|
local vm_data = vm:get_data()
|
|
|
|
|
2018-07-22 18:28:23 +02:00
|
|
|
multi_map.generate_singlenode_chunk(minp, maxp, area, vm_data, multi_map.node[multi_map.skyrock])
|
2018-07-22 14:24:43 +02:00
|
|
|
|
2018-07-17 22:59:58 +02:00
|
|
|
vm:set_lighting({day=15, night=0})
|
2018-07-17 21:16:37 +02:00
|
|
|
vm:set_data(vm_data)
|
|
|
|
vm:calc_lighting(false)
|
|
|
|
vm:write_to_map(false)
|
|
|
|
else
|
2018-07-22 14:24:43 +02:00
|
|
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
|
|
|
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
|
|
|
|
local vm_data = vm:get_data()
|
|
|
|
local remove_shadow_caster = false
|
|
|
|
|
|
|
|
-- Add a temporary stone layer above the chunk to ensure caves are dark
|
|
|
|
if multi_map.get_absolute_centerpoint() >= maxp.y then
|
2018-07-22 18:28:23 +02:00
|
|
|
if vm_data[area:index(minp.x, maxp.y + 1, minp.z)] == multi_map.node["ignore"] then
|
2018-07-22 14:24:43 +02:00
|
|
|
remove_shadow_caster = true
|
2018-07-22 18:28:23 +02:00
|
|
|
multi_map.generate_singlenode_plane(minp, maxp, area, vm_data, maxp.y + 1, multi_map.node["multi_map_core:shadow_caster"])
|
2018-07-22 14:24:43 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-18 23:22:18 +02:00
|
|
|
local t = multi_map.generators[multi_map.current_layer]
|
2018-07-21 12:20:46 +02:00
|
|
|
|
2018-07-18 23:22:18 +02:00
|
|
|
if not t then
|
|
|
|
if multi_map.fallback_generator then
|
2018-07-22 14:24:43 +02:00
|
|
|
multi_map.fallback_generator.generator(multi_map.current_layer, vm, area, vm_data, minp, maxp, offset_minp, offset_maxp, multi_map.fallback_generator.arguments)
|
2018-07-18 23:22:18 +02:00
|
|
|
else
|
2018-07-23 20:46:26 +02:00
|
|
|
minetest.log("error", "[multi_map] Generator for layer "..multi_map.current_layer.." missing and no fallback specified, exiting mapgen!")
|
2018-07-18 23:22:18 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
else
|
|
|
|
for i,f in ipairs(t) do
|
2018-07-22 14:24:43 +02:00
|
|
|
f.generator(multi_map.current_layer, vm, area, vm_data, minp, maxp, offset_minp, offset_maxp, f.arguments)
|
2018-07-18 23:22:18 +02:00
|
|
|
end
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|
2018-07-22 14:24:43 +02:00
|
|
|
|
|
|
|
vm:set_data(vm_data)
|
|
|
|
vm:calc_lighting()
|
|
|
|
vm:write_to_map()
|
|
|
|
vm:update_liquids()
|
|
|
|
|
|
|
|
-- Remove the temporary stone shadow casting layer again, if needed
|
|
|
|
if remove_shadow_caster then
|
2018-07-22 18:28:23 +02:00
|
|
|
if vm_data[area:index(minp.x, maxp.y + 1, minp.z)] == multi_map.node["multi_map_core:shadow_caster"] then
|
|
|
|
multi_map.generate_singlenode_plane(minp, maxp, area, vm_data, maxp.y + 1, multi_map.node["ignore"])
|
2018-07-22 14:24:43 +02:00
|
|
|
vm:set_data(vm_data)
|
|
|
|
vm:write_to_map()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|
2018-07-23 20:46:26 +02:00
|
|
|
|
|
|
|
map_cache = {}
|
2018-07-17 21:16:37 +02:00
|
|
|
end)
|
|
|
|
|
2018-07-17 22:59:58 +02:00
|
|
|
minetest.register_node("multi_map_core:skyrock", {
|
2018-07-17 21:16:37 +02:00
|
|
|
description = "Multi Map Impenetrable Skyblock",
|
|
|
|
drawtype = "airlike",
|
|
|
|
is_ground_content = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = true,
|
|
|
|
pointable = false,
|
|
|
|
diggable = false,
|
|
|
|
climbable = false,
|
|
|
|
paramtype = "light",
|
|
|
|
})
|
|
|
|
|
2018-07-22 14:24:43 +02:00
|
|
|
minetest.register_node("multi_map_core:shadow_caster", {
|
|
|
|
description = "Multi Map Shadow Caster",
|
|
|
|
drawtype = "airlike",
|
|
|
|
is_ground_content = false,
|
|
|
|
sunlight_propagates = false,
|
|
|
|
walkable = false,
|
|
|
|
pointable = false,
|
|
|
|
diggable = false,
|
|
|
|
climbable = false,
|
|
|
|
})
|
|
|
|
|
2018-07-17 22:59:58 +02:00
|
|
|
minetest.register_node("multi_map_core:bedrock", {
|
2018-07-17 21:16:37 +02:00
|
|
|
description = "Multi Map Impenetrable Bedrock",
|
|
|
|
drawtype = "normal",
|
|
|
|
tiles ={"multi_map_bedrock.png"},
|
|
|
|
is_ground_content = false,
|
|
|
|
walkable = true,
|
|
|
|
pointable = false,
|
|
|
|
diggable = false,
|
|
|
|
climbable = false,
|
|
|
|
})
|