Replace deprecated minetest.env
This commit is contained in:
parent
6c764f0c3b
commit
6cbfcde873
1 changed files with 8 additions and 8 deletions
16
goblin.lua
16
goblin.lua
|
@ -380,7 +380,7 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 0.95)) do -- IDKWTF this is but it works
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 0.95)) do -- IDKWTF this is but it works
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
object:set_physics_override({speed = 0.1})
|
object:set_physics_override({speed = 0.1})
|
||||||
minetest.after(1, function() -- this effect is temporary
|
minetest.after(1, function() -- this effect is temporary
|
||||||
|
@ -410,7 +410,7 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
minetest.set_node(pos, {name="fire:basic_flame"})
|
minetest.set_node(pos, {name="fire:basic_flame"})
|
||||||
if object:get_hp() > 0 then
|
if object:get_hp() > 0 then
|
||||||
|
@ -439,7 +439,7 @@ if (not singleplayer and setting ~= true) or (singleplayer and setting == false)
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 3)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
minetest.set_node(pos, {name="default:lava_source"})
|
minetest.set_node(pos, {name="default:lava_source"})
|
||||||
if object:get_hp() > 0 then
|
if object:get_hp() > 0 then
|
||||||
|
@ -456,7 +456,7 @@ else
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 3)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
minetest.set_node(pos, {name="tnt:tnt_burning"})
|
minetest.set_node(pos, {name="tnt:tnt_burning"})
|
||||||
minetest.get_node_timer(pos):start(5)
|
minetest.get_node_timer(pos):start(5)
|
||||||
|
@ -502,7 +502,7 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
minetest.set_node(pos, {name="fun_caves:molten_gold_source"})
|
minetest.set_node(pos, {name="fun_caves:molten_gold_source"})
|
||||||
if object:get_hp() > 0 then
|
if object:get_hp() > 0 then
|
||||||
|
@ -527,7 +527,7 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
local ppos = object:getpos()
|
local ppos = object:getpos()
|
||||||
if ppos then
|
if ppos then
|
||||||
|
@ -565,7 +565,7 @@ minetest.register_abm({
|
||||||
interval = 2,
|
interval = 2,
|
||||||
chance = 2,
|
chance = 2,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
if object:get_hp() > 0 then
|
if object:get_hp() > 0 then
|
||||||
object:set_hp(object:get_hp()-1)
|
object:set_hp(object:get_hp()-1)
|
||||||
|
@ -608,7 +608,7 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 2,
|
chance = 2,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 3)) do
|
||||||
if object:is_player() then
|
if object:is_player() then
|
||||||
if object:get_hp() > 0 then
|
if object:get_hp() > 0 then
|
||||||
object:set_hp(object:get_hp()-1)
|
object:set_hp(object:get_hp()-1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue