cleanup and improvements
This commit is contained in:
parent
00938b043f
commit
8df0c06d6a
@ -188,7 +188,7 @@ function spawners_mobs.start_spawning(spawn_area_random_pos, mob_name, mod_prefi
|
|||||||
minetest.sound_play(sound_name, {
|
minetest.sound_play(sound_name, {
|
||||||
pos = spawn_area_random_pos[i],
|
pos = spawn_area_random_pos[i],
|
||||||
max_hear_distance = 8,
|
max_hear_distance = 8,
|
||||||
gain = 0.3
|
gain = 0.5
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -385,7 +385,11 @@ function spawners_mobs.set_status(pos, set_status)
|
|||||||
if set_status == "active" then
|
if set_status == "active" then
|
||||||
-- remove particles and add them again - keeps particles after server restart
|
-- remove particles and add them again - keeps particles after server restart
|
||||||
-- delete particles
|
-- delete particles
|
||||||
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil then
|
|
||||||
|
-- print("id_flame: "..id_flame)
|
||||||
|
-- print("id_smoke: "..id_smoke)
|
||||||
|
|
||||||
|
if id_flame and id_smoke then
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
end
|
end
|
||||||
@ -410,7 +414,7 @@ function spawners_mobs.set_status(pos, set_status)
|
|||||||
--
|
--
|
||||||
elseif set_status == "waiting" and meta_status ~= set_status then
|
elseif set_status == "waiting" and meta_status ~= set_status then
|
||||||
-- delete particles
|
-- delete particles
|
||||||
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil then
|
if id_flame and id_smoke then
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
end
|
end
|
||||||
@ -434,7 +438,7 @@ function spawners_mobs.set_status(pos, set_status)
|
|||||||
--
|
--
|
||||||
elseif set_status == "rusty" and meta_status ~= set_status then
|
elseif set_status == "rusty" and meta_status ~= set_status then
|
||||||
-- delete particles
|
-- delete particles
|
||||||
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil then
|
if id_flame and id_smoke then
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
end
|
end
|
||||||
|
@ -63,6 +63,8 @@ function spawners_mobs.create(mob_table, idx)
|
|||||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name())
|
meta:set_string("owner", placer:get_player_name())
|
||||||
|
|
||||||
|
meta:set_string("infotext", mob_name.." spawner\nowner: "..placer:get_player_name().."\nspawner is active")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user