From 1c14c220e46a7b77b1d24eea3d993584903d1625 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 30 Nov 2014 13:20:15 -0500 Subject: [PATCH] minetest.env:* --> minetest.* --- arrow.lua | 6 +++--- crossbow.lua | 4 ++-- jailbars.lua | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arrow.lua b/arrow.lua index b5ae0ee..c135f5f 100644 --- a/arrow.lua +++ b/arrow.lua @@ -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 diff --git a/crossbow.lua b/crossbow.lua index be0ebc3..f0ecda4 100644 --- a/crossbow.lua +++ b/crossbow.lua @@ -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', ''}, } -}) \ No newline at end of file +}) diff --git a/jailbars.lua b/jailbars.lua index aa616ec..f1e01bf 100644 --- a/jailbars.lua +++ b/jailbars.lua @@ -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)