1
0
Fork 0

Update desert temple schematic

This commit is contained in:
Wuzzy 2018-01-17 19:30:43 +01:00
parent dba463ca6d
commit ec49459eb4
2 changed files with 12 additions and 3 deletions

View File

@ -236,9 +236,10 @@ mcl_structures.generate_desert_temple = function(pos)
local chests = minetest.find_nodes_in_area({x=newpos.x-size.x, y=newpos.y, z=newpos.z-size.z}, vector.add(newpos, size), "mcl_chests:chest")
-- Add desert temple loot into chests
for c=1, #chests do
-- FIXME: Use better seeding
local pr = PseudoRandom(math.random(0, 4294967295))
for c=1, #chests do
-- FIXME: Use better seeding
local lootitems = mcl_loot.get_multi_loot({
{
stacks_min = 2,
@ -283,11 +284,19 @@ mcl_structures.generate_desert_temple = function(pos)
end
end
-- Initialize pressure plates
-- Initialize pressure plates and randomly remove up to 5 plates
local pplates = minetest.find_nodes_in_area({x=newpos.x-size.x, y=newpos.y, z=newpos.z-size.z}, vector.add(newpos, size), "mesecons_pressureplates:pressure_plate_stone_off")
local pplates_remove = 5
for p=1, #pplates do
if pplates_remove > 0 and pr:next(1, 100) >= 50 then
-- Remove plate
minetest.remove_node(pplates[p])
pplates_remove = pplates_remove - 1
else
-- Initialize plate
minetest.registered_nodes["mesecons_pressureplates:pressure_plate_stone_off"].on_construct(pplates[p])
end
end
return ret
end