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)
This commit is contained in:
parent
2600ce6a37
commit
368ce24d0e
10
abms.lua
10
abms.lua
@ -2,12 +2,18 @@
|
|||||||
local fortress = minetest.get_modpath("caverealms").."/schems/DMFort.mts"
|
local fortress = minetest.get_modpath("caverealms").."/schems/DMFort.mts"
|
||||||
local fountain = minetest.get_modpath("caverealms").."/schems/DMFountain.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
|
--place Dungeon Master Statue fountains
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"caverealms:s_fountain"},
|
nodenames = {"caverealms:s_fountain"},
|
||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
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)
|
minetest.place_schematic(pos, fountain, "random", {}, true)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@ -18,6 +24,10 @@ minetest.register_abm({
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
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}
|
npos = {x=pos.x,y=pos.y-7,z=pos.z}
|
||||||
minetest.place_schematic(npos, fortress, "random", {}, true)
|
minetest.place_schematic(npos, fortress, "random", {}, true)
|
||||||
end,
|
end,
|
||||||
|
BIN
textures/fire_basic_flame.png
Normal file
BIN
textures/fire_basic_flame.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 719 B |
BIN
textures/fire_basic_flame_animated.png
Normal file
BIN
textures/fire_basic_flame_animated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user