Add function to query stronghold positions

This commit is contained in:
Wuzzy 2017-12-10 18:48:34 +01:00
parent 2d8ad7ebf0
commit 55778ab375
2 changed files with 24 additions and 1 deletions

View file

@ -52,7 +52,7 @@ local init_strongholds = function()
end
local pos = { x = math.cos(angle) * dist, y = y, z = math.sin(angle) * dist }
pos = vector.round(pos)
table.insert(strongholds, { pos = pos })
table.insert(strongholds, { pos = pos, generated = false })
-- Rotate angle by (360 / amount) degrees.
-- This will cause the angles to be evenly distributed in the stronghold ring
@ -90,6 +90,12 @@ local generate_strongholds = function(minp, maxp)
end
end
-- Minimal API
mcl_strongholds = {}
mcl_strongholds.get_stronghold_positions = function()
return table.copy(strongholds)
end
init_strongholds()