Fix deprecated calls
This commit is contained in:
parent
a2bd86376c
commit
410e318293
@ -64,7 +64,7 @@ arrow.on_step = function(self, dtime,moveresult)
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, self.radius)) do
|
||||
local owner = minetest.get_player_by_name(self.owner)
|
||||
if owner then
|
||||
self.object:setacceleration(vector.new(0,0,0))
|
||||
self.object:set_acceleration(vector.new(0,0,0))
|
||||
--get the variables
|
||||
local pos2 = owner:get_pos()
|
||||
local player_velocity = owner:get_player_velocity()
|
||||
@ -84,7 +84,7 @@ arrow.on_step = function(self, dtime,moveresult)
|
||||
|
||||
local velocity = vector.add(player_velocity,velocity)
|
||||
|
||||
self.object:setvelocity(velocity)
|
||||
self.object:set_velocity(velocity)
|
||||
|
||||
if distance < 0.2 then
|
||||
self.object:remove()
|
||||
|
@ -39,7 +39,7 @@ if not creative_mode then
|
||||
local x=math.random(-2,2)*math.random()
|
||||
local y=math.random(2,5)
|
||||
local z=math.random(-2,2)*math.random()
|
||||
obj:setvelocity({x=x, y=y, z=z})
|
||||
obj:set_velocity({x=x, y=y, z=z})
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -120,7 +120,7 @@ function minetest.throw_experience(pos, amount)
|
||||
local x=math.random(-2,2)*math.random()
|
||||
local y=math.random(2,5)
|
||||
local z=math.random(-2,2)*math.random()
|
||||
obj:setvelocity({x=x, y=y, z=z})
|
||||
obj:set_velocity({x=x, y=y, z=z})
|
||||
end
|
||||
end
|
||||
--return obj
|
||||
@ -274,7 +274,7 @@ minetest.register_entity(":__builtin:item", {
|
||||
local x=math.random(-2,2)*math.random()
|
||||
local y=math.random(2,5)
|
||||
local z=math.random(-2,2)*math.random()
|
||||
self.object:setvelocity(vector.new(x,y,z))
|
||||
self.object:set_velocity(vector.new(x,y,z))
|
||||
-- print(self.collection_timer)
|
||||
end
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
@ -309,11 +309,11 @@ minetest.register_entity(":__builtin:item", {
|
||||
end
|
||||
local collector = minetest.get_player_by_name(self.collector)
|
||||
if collector then
|
||||
self.object:setacceleration(vector.new(0,0,0))
|
||||
self.object:set_acceleration(vector.new(0,0,0))
|
||||
self.disable_physics(self)
|
||||
--get the variables
|
||||
local pos = self.object:getpos()
|
||||
local pos2 = collector:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local pos2 = collector:get_pos()
|
||||
local player_velocity = collector:get_player_velocity()
|
||||
pos2.y = pos2.y + self.collection_height
|
||||
|
||||
@ -331,7 +331,7 @@ minetest.register_entity(":__builtin:item", {
|
||||
|
||||
local velocity = vector.add(player_velocity,velocity)
|
||||
|
||||
self.object:setvelocity(velocity)
|
||||
self.object:set_velocity(velocity)
|
||||
|
||||
if distance < 0.2 then
|
||||
self.object:remove()
|
||||
|
@ -21,7 +21,7 @@ minetest.register_globalstep(function(dtime)
|
||||
--radial detection
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius({x=pos.x,y=pos.y+0.5,z=pos.z}, 2)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
local pos2 = object:getpos()
|
||||
local pos2 = object:get_pos()
|
||||
local diff = vector.subtract(pos2,pos).y
|
||||
if diff >= 0 and inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
if object:get_luaentity().collectable == true and object:get_luaentity().collected == false then
|
||||
@ -33,7 +33,7 @@ minetest.register_globalstep(function(dtime)
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
object:get_luaentity().collector = player:get_player_name()
|
||||
object:get_luaentity().collected = true
|
||||
-- print("Set flag at item: "..dump(object:getpos()))
|
||||
-- print("Set flag at item: "..dump(object:get_pos()))
|
||||
--object:moveto({x=pos.x,y=pos.y+eye_height,z=pos.z,continuous=true})
|
||||
|
||||
end
|
||||
|
@ -20,7 +20,7 @@ mobs.create_data_handling_functions = function(def,mob_register)
|
||||
|
||||
mob_register.on_activate = function(self, staticdata, dtime_s)
|
||||
global_mob_amount = global_mob_amount + 1
|
||||
print("Mobs Spawned. Current Mobs: "..global_mob_amount)
|
||||
--print("Mobs Spawned. Current Mobs: "..global_mob_amount)
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
--self.object:set_velocity({x = math.random(-5,5), y = 5, z = math.random(-5,5)})
|
||||
self.object:set_acceleration(def.gravity)
|
||||
|
@ -260,7 +260,7 @@ mobs.create_interaction_functions = function(def,mob_register)
|
||||
end
|
||||
|
||||
global_mob_amount = global_mob_amount - 1
|
||||
print("Mobs Died. Current Mobs: "..global_mob_amount)
|
||||
--print("Mobs Died. Current Mobs: "..global_mob_amount)
|
||||
|
||||
if self.custom_on_death then
|
||||
self.custom_on_death(self)
|
||||
|
Loading…
x
Reference in New Issue
Block a user