Get rid of deprecated minetest.env calls

This commit is contained in:
Wuzzy 2017-07-06 15:24:11 +02:00
parent 5bf2b79f28
commit a73fa20028
3 changed files with 8 additions and 9 deletions

View File

@ -114,7 +114,6 @@ local throwing_shoot_arrow = function(itemstack, player)
player:get_inventory():remove_item("main", arrow[1])
end
local playerpos = player:getpos()
--local obj = minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --current
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc
local dir = player:get_look_dir()
obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})

View File

@ -108,7 +108,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
local pos = self.object:getpos()
local n = minetest.env:get_node(pos).name
local n = minetest.get_node(pos).name
if self.timer == 0 then
self.timer = os.time()
@ -118,7 +118,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
self.object:remove()
end
local objects = minetest.env:get_objects_inside_radius(pos, 1)
local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do
local name = obj:get_entity_name()
if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then
@ -131,13 +131,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
end
end
minetest.env:set_node(pos, {name="air"})
minetest.set_node(pos, {name="air"})
if math.random(1,2)==1 then
dx = math.random(-1,1)
dy = math.random(-1,1)
dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
minetest.env:set_node(p, {name="air"})
minetest.set_node(p, {name="air"})
end
end
})

View File

@ -83,7 +83,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
local pos = self.object:getpos()
local n = minetest.env:get_node(pos).name
local n = minetest.get_node(pos).name
if self.timer == 0 then
self.timer = os.time()
@ -93,7 +93,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
self.object:remove()
end
local objects = minetest.env:get_objects_inside_radius(pos, 1)
local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do
local name = obj:get_entity_name()
if name~="mobs_mc:roar_of_the_dragon" and name ~= "mobs_mc:wither" then
@ -106,13 +106,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
end
end
minetest.env:set_node(pos, {name="air"})
minetest.set_node(pos, {name="air"})
if math.random(1,2)==1 then
dx = math.random(-1,1)
dy = math.random(-1,1)
dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
minetest.env:set_node(p, {name="air"})
minetest.set_node(p, {name="air"})
end
end
})