Add the first status symbol amenity that increases maximum area volume

This commit is contained in:
codefairy 2019-09-02 15:42:19 -04:00
parent 616e3b4e2d
commit 864dc7e4db

View File

@ -59,7 +59,9 @@ minetest.register_node("maggems_landmark:home", {
minetest.chat_send_player(sender:get_player_name(), "Invalid corners!")
return false
end
if ((1+pos2.x-pos1.x) * (1+pos2.y-pos1.y) * (1+pos2.z-pos1.z) > 343) then
local maxvol = meta:get_int("maggems_landmark:maxvol")
if (maxvol == 0) then maxvol = 7*7*7 end
if ((1+pos2.x-pos1.x) * (1+pos2.y-pos1.y) * (1+pos2.z-pos1.z) > maxvol) then
minetest.chat_send_player(sender:get_player_name(), "Space too big!")
return false
end
@ -100,3 +102,37 @@ minetest.register_craft({
}
})
minetest.register_node("maggems_landmark:statsym_iron", {
description = "Iron Status Symbol",
tiles = {"maggems_landmark_statsym.png^maggems_landmark_border_iron.png"},
is_ground_content = false,
paramtype = "light",
light_source = 3,
groups = {cracky = 1, level = 1},
sounds = default.node_sound_stone_defaults(),
after_place_node = function(pos, player)
for id, area in pairs(maggems_landmark.homes:get_areas_for_pos(pos, true, true)) do
maggems_landmark.update_amenities(area)
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, player)
for id, area in pairs(maggems_landmark.homes:get_areas_for_pos(pos, true, true)) do
maggems_landmark.update_amenities(area)
end
end,
on_blast = function() end,
})
maggems_landmark.register_amenity("maggems_landmark:statsym_iron",
function(meta) meta:set_int("maggems_landmark:maxvol", 11*11*11) end,
function(meta) meta:set_int("maggems_landmark:maxvol", 7*7*7) end
)
minetest.register_craft({
output = "maggems_landmark:statsym_iron",
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:mese", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
})