mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-08-28 20:38:12 +02:00
mcl_structures Check if file exists before placing schematics
This commit is contained in:
parent
62f353d54f
commit
6bc12ec5ec
@ -1537,7 +1537,6 @@ local function register_dimension_biomes()
|
|||||||
place_on = {"mcl_core:bedrock"},
|
place_on = {"mcl_core:bedrock"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
fill_ratio = 10,
|
fill_ratio = 10,
|
||||||
biomes = { "Nether" },
|
|
||||||
y_min = mcl_vars.mg_lava_nether_max,
|
y_min = mcl_vars.mg_lava_nether_max,
|
||||||
y_max = mcl_vars.mg_nether_max + 15,
|
y_max = mcl_vars.mg_nether_max + 15,
|
||||||
height = 6,
|
height = 6,
|
||||||
|
@ -32,6 +32,9 @@ local function ecb_place(blockpos, action, calls_remaining, param)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mcl_structures.place_schematic(pos, schematic, rotation, replacements, force_placement, flags, after_placement_callback, pr, callback_param)
|
function mcl_structures.place_schematic(pos, schematic, rotation, replacements, force_placement, flags, after_placement_callback, pr, callback_param)
|
||||||
|
if not mcl_util.file_exists(schematic) then
|
||||||
|
minetest.log("warning","[mcl_structures] schematic file "..schematic.." does not exist.")
|
||||||
|
return end
|
||||||
local s = loadstring(minetest.serialize_schematic(schematic, "lua", {lua_use_comments = false, lua_num_indent_spaces = 0}) .. " return schematic")()
|
local s = loadstring(minetest.serialize_schematic(schematic, "lua", {lua_use_comments = false, lua_num_indent_spaces = 0}) .. " return schematic")()
|
||||||
if s and s.size then
|
if s and s.size then
|
||||||
local x, z = s.size.x, s.size.z
|
local x, z = s.size.x, s.size.z
|
||||||
|
Loading…
Reference in New Issue
Block a user