forked from Mirrorlandia_minetest/mod-sneeker
Add method 'sneeker.get_pos_string':
Returns x, y, z coordinates in a string.
This commit is contained in:
parent
21d78e0b65
commit
fe42ca01db
@ -23,3 +23,8 @@ function sneeker.spawn(pos)
|
|||||||
minetest.add_entity(pos, sneeker.mob_name)
|
minetest.add_entity(pos, sneeker.mob_name)
|
||||||
sneeker.log_debug('Spawned entity "' .. sneeker.mob_name .. '" at ' .. tostring(pos.x) .. ',' .. tostring(pos.y))
|
sneeker.log_debug('Spawned entity "' .. sneeker.mob_name .. '" at ' .. tostring(pos.x) .. ',' .. tostring(pos.y))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Retrieves pos coordinates in string value
|
||||||
|
function sneeker.get_pos_string(pos)
|
||||||
|
return 'x=' .. tostring(pos.x) .. ', y=' .. tostring(pos.y) .. ', z=' .. tostring(pos.z)
|
||||||
|
end
|
||||||
|
@ -29,7 +29,7 @@ minetest.register_abm({
|
|||||||
local node_light = minetest.get_node_light(pos)
|
local node_light = minetest.get_node_light(pos)
|
||||||
|
|
||||||
-- Debugging spawning
|
-- Debugging spawning
|
||||||
sneeker.log_debug("Node light level at " .. tostring(pos.x) .. "," .. tostring(pos.y) .. ": " .. tostring(node_light))
|
sneeker.log_debug("Node light level at " .. sneeker.get_pos_string(pos) .. ": " .. tostring(node_light))
|
||||||
|
|
||||||
if not node_light or node_light > sneeker.spawn_maxlight or node_light < -1 then
|
if not node_light or node_light > sneeker.spawn_maxlight or node_light < -1 then
|
||||||
spawnit = false
|
spawnit = false
|
||||||
|
Loading…
Reference in New Issue
Block a user