1
0
Fork 0

mcl_structures Check if file exists before placing schematics

turtlestriderbeefox
cora 2022-10-28 01:02:48 +02:00
parent 62f353d54f
commit 6bc12ec5ec
2 changed files with 3 additions and 1 deletions

View File

@ -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,

View File

@ -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