minetest.env:* --> minetest.*

master
Vanessa Ezekowitz 2014-11-30 13:20:15 -05:00
parent fe80148e4a
commit 1c14c220e4
3 changed files with 8 additions and 8 deletions

View File

@ -42,10 +42,10 @@ local castle_ARROW_ENTITY={
castle_ARROW_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.env:get_node(pos)
local node = minetest.get_node(pos)
if self.timer>0.2 then
local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "castle:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then
@ -75,7 +75,7 @@ castle_ARROW_ENTITY.on_step = function(self, dtime)
if self.lastpos.x~=nil then
if node.name ~= "air" then
minetest.env:add_item(self.lastpos, 'castle:arrow')
minetest.add_item(self.lastpos, 'castle:arrow')
self.object:remove()
end
end

View File

@ -9,7 +9,7 @@ local castle_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])
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2])
local dir = player:get_look_dir()
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
obj:setacceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
@ -45,4 +45,4 @@ minetest.register_craft({
{'farming:string', 'farming:string', 'farming:string'},
{'', 'default:stick', ''},
}
})
})

View File

@ -12,12 +12,12 @@ local directions = {
}
local function update_jailbars(pos)
if minetest.env:get_node(pos).name:find("castle:jailbars") == nil then
if minetest.get_node(pos).name:find("castle:jailbars") == nil then
return
end
local sum = 0
for i = 1, 4 do
local node = minetest.env:get_node({x = pos.x + directions[i].x, y = pos.y + directions[i].y, z = pos.z + directions[i].z})
local node = minetest.get_node({x = pos.x + directions[i].x, y = pos.y + directions[i].y, z = pos.z + directions[i].z})
if minetest.registered_nodes[node.name].walkable ~= false then
sum = sum + 2 ^ (i - 1)
end
@ -25,7 +25,7 @@ local function update_jailbars(pos)
if sum == 0 then
sum = 15
end
minetest.env:add_node(pos, {name = "castle:jailbars_"..sum})
minetest.add_node(pos, {name = "castle:jailbars_"..sum})
end
local function update_nearby(pos)