forked from minetest-mods/BobBlocks
minetest.env:* --> minetest.*
This commit is contained in:
parent
f38635c3ec
commit
42f087b67f
@ -41,7 +41,7 @@ local update_bobblock = function (pos, node)
|
||||
elseif node.name == 'bobblocks:whitepole_off' then nodename = 'bobblocks:whitepole'
|
||||
elseif node.name == 'bobblocks:whitepole' then nodename = 'bobblocks:whitepole_off'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.add_node(pos, {name = nodename})
|
||||
minetest.sound_play("bobblocks_glassblock",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ local update_healthpack = function (pos, node)
|
||||
elseif node.name == 'bobblocks:health_on' then
|
||||
nodename = 'bobblocks:health_off'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
local toggle_healthpack = function (pos, node)
|
||||
@ -69,12 +69,12 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
minetest.sound_play("bobblocks_health",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
||||
minetest.env:remove_node(pos) -- remove the node after use
|
||||
minetest.remove_node(pos) -- remove the node after use
|
||||
end
|
||||
end,
|
||||
|
||||
|
10
trap.lua
10
trap.lua
@ -11,7 +11,7 @@ local update_bobtrap = function (pos, node)
|
||||
elseif node.name == 'bobblocks:trap_spike_major' then nodename = 'bobblocks:trap_spike_major_set'
|
||||
elseif node.name == 'bobblocks:trap_spike_major_set' then nodename = 'bobblocks:trap_spike_major'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
-- Punch Traps
|
||||
@ -35,7 +35,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
@ -49,7 +49,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
@ -158,7 +158,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-1)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
@ -172,7 +172,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-100)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
|
Loading…
Reference in New Issue
Block a user