Fix to grief prevention, backup textures

Original code to prevent spawners failed, now corrected.  Added backup
image of fire for servers without fire enabled. (Fire is non-placeable)
master
Chris N 2015-01-06 12:33:31 -10:00
parent 2600ce6a37
commit 368ce24d0e
3 changed files with 10 additions and 0 deletions

View File

@ -2,12 +2,18 @@
local fortress = minetest.get_modpath("caverealms").."/schems/DMFort.mts"
local fountain = minetest.get_modpath("caverealms").."/schems/DMFountain.mts"
local DM_TOP = caverealms.config.dm_top -- -4000 --level at which Dungeon Master Realms start to appear
--place Dungeon Master Statue fountains
minetest.register_abm({
nodenames = {"caverealms:s_fountain"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if pos.y > DM_TOP then
minetest.remove_node(pos)
return
end
minetest.place_schematic(pos, fountain, "random", {}, true)
end,
})
@ -18,6 +24,10 @@ minetest.register_abm({
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if pos.y > DM_TOP then
minetest.remove_node(pos)
return
end
npos = {x=pos.x,y=pos.y-7,z=pos.z}
minetest.place_schematic(npos, fortress, "random", {}, true)
end,

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB