Fix deprecated methods
This commit is contained in:
parent
5d3c6d4a44
commit
483d35a635
@ -277,19 +277,19 @@ local ambienceList = {
|
||||
}
|
||||
|
||||
local is_daytime = function()
|
||||
return (minetest.env:get_timeofday() > 0.2 and minetest.env:get_timeofday() < 0.8)
|
||||
return (minetest:get_timeofday() > 0.2 and minetest:get_timeofday() < 0.8)
|
||||
end
|
||||
|
||||
local nodes_in_range = function(pos, search_distance, node_name)
|
||||
local minp = {x=pos.x-search_distance,y=pos.y-search_distance, z=pos.z-search_distance}
|
||||
local maxp = {x=pos.x+search_distance,y=pos.y+search_distance, z=pos.z+search_distance}
|
||||
local nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
--minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
return #nodes
|
||||
end
|
||||
|
||||
local nodes_in_coords = function(minp, maxp, node_name)
|
||||
local nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
--minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
return #nodes
|
||||
end
|
||||
@ -299,7 +299,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
-- minetest.chat_send_all("counter: (" .. counter .. ")")
|
||||
local minp = {x=pos.x-search_distance,y=height, z=pos.z+20}
|
||||
local maxp = {x=pos.x+search_distance,y=height, z=pos.z+20}
|
||||
local nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
-- minetest.chat_send_all("z+Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
@ -307,7 +307,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
local totalnodes = #nodes
|
||||
minp = {x=pos.x-search_distance,y=height, z=pos.z-20}
|
||||
maxp = {x=pos.x+search_distance,y=height, z=pos.z-20}
|
||||
nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
-- minetest.chat_send_all("z-Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
@ -315,7 +315,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
totalnodes = totalnodes + #nodes
|
||||
maxp = {x=pos.x+20,y=height, z=pos.z+search_distance}
|
||||
minp = {x=pos.x+20,y=height, z=pos.z-search_distance}
|
||||
nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
@ -323,7 +323,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
totalnodes = totalnodes + #nodes
|
||||
maxp = {x=pos.x-20,y=height, z=pos.z+search_distance}
|
||||
minp = {x=pos.x-20,y=height, z=pos.z-search_distance}
|
||||
nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
@ -338,14 +338,14 @@ end
|
||||
|
||||
local get_immediate_nodes = function(pos)
|
||||
pos.y = pos.y-1
|
||||
node_under_feet = minetest.env:get_node(pos).name
|
||||
node_under_feet = minetest:get_node(pos).name
|
||||
pos.y = pos.y-3
|
||||
node_3_under_feet = minetest.env:get_node(pos).name
|
||||
node_3_under_feet = minetest:get_node(pos).name
|
||||
pos.y = pos.y+3
|
||||
pos.y = pos.y+2.2
|
||||
node_at_upper_body = minetest.env:get_node(pos).name
|
||||
node_at_upper_body = minetest:get_node(pos).name
|
||||
pos.y = pos.y-1.19
|
||||
node_at_lower_body = minetest.env:get_node(pos).name
|
||||
node_at_lower_body = minetest:get_node(pos).name
|
||||
pos.y = pos.y+0.99
|
||||
--minetest.chat_send_all("node_under_feet(" .. nodename .. ")")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user