mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 05:43:43 +01:00
old registered_structures -> structure_data
This commit is contained in:
parent
deeb7ce919
commit
899c849996
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user