old registered_structures -> structure_data

This commit is contained in:
cora 2022-06-06 01:46:32 +02:00
parent deeb7ce919
commit 899c849996
3 changed files with 9 additions and 9 deletions

@ -87,7 +87,7 @@ minetest.register_craftitem("mcl_end:ender_eye", {
end
local origin = user:get_pos()
origin.y = origin.y + 1.5
local strongholds = mcl_structures.get_registered_structures("stronghold")
local strongholds = mcl_structures.get_structure_data("stronghold")
local dim = mcl_worlds.pos_to_dimension(origin)
local is_creative = minetest.is_creative_enabled(user:get_player_name())

@ -61,7 +61,7 @@ local function init_strongholds()
end
end
mcl_structures.register_structures("stronghold", table.copy(strongholds))
mcl_structures.register_structure_data("stronghold", table.copy(strongholds))
strongholds_inited = true
end

@ -530,7 +530,7 @@ function mcl_structures.generate_desert_temple(pos, rotation, pr)
mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true, nil, temple_placement_callback, pr)
end
local registered_structures = {}
local structure_data = {}
--[[ Returns a table of structure of the specified type.
Currently the only valid parameter is "stronghold".
@ -543,18 +543,18 @@ Format of return value:
TODO: Implement this function for all other structure types as well.
]]
function mcl_structures.get_registered_structures(structure_type)
if registered_structures[structure_type] then
return table.copy(registered_structures[structure_type])
function mcl_structures.get_structure_data(structure_type)
if structure_data[structure_type] then
return table.copy(structure_data[structure_type])
else
return {}
end
end
-- Register a structures table for the given type. The table format is the same as for
-- mcl_structures.get_registered_structures.
function mcl_structures.register_structures(structure_type, structures)
registered_structures[structure_type] = structures
-- mcl_structures.get_structure_data.
function mcl_structures.register_structure_data(structure_type, structures)
structure_data[structure_type] = structures
end
local function dir_to_rotation(dir)