Add support for minetest.swap_node

This commit is contained in:
ShadowNinja
2013-12-10 20:14:39 -05:00
parent 818a0e5ff0
commit f3d8b47b20
19 changed files with 71 additions and 71 deletions

View File

@ -178,7 +178,7 @@ minetest.register_abm({
if node.name == "technic:forcefield_emitter_on" then
meta:set_int("HV_EU_demand", 0)
update_forcefield(pos, meta:get_int("range"), false)
hacky_swap_node(pos, "technic:forcefield_emitter_off")
technic.swap_node(pos, "technic:forcefield_emitter_off")
meta:set_string("infotext", S("%s Disabled"):format(machine_name))
return
end
@ -186,11 +186,11 @@ minetest.register_abm({
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
if node.name == "technic:forcefield_emitter_on" then
update_forcefield(pos, meta:get_int("range"), false)
hacky_swap_node(pos, "technic:forcefield_emitter_off")
technic.swap_node(pos, "technic:forcefield_emitter_off")
end
elseif eu_input >= power_requirement then
if node.name == "technic:forcefield_emitter_off" then
hacky_swap_node(pos, "technic:forcefield_emitter_on")
technic.swap_node(pos, "technic:forcefield_emitter_on")
meta:set_string("infotext", S("%s Active"):format(machine_name))
end
update_forcefield(pos, meta:get_int("range"), true)

View File

@ -214,7 +214,7 @@ minetest.register_abm({
if correct_fuel_count == 6 and
check_reactor_structure(pos) then
meta:set_int("burn_time", 1)
hacky_swap_node(pos, "technic:hv_nuclear_reactor_core_active")
technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active")
meta:set_int("HV_EU_supply", power_supply)
for idx, srcstack in pairs(srclist) do
srcstack:take_item()
@ -226,7 +226,7 @@ minetest.register_abm({
meta:set_int("HV_EU_supply", 0)
meta:set_int("burn_time", 0)
meta:set_string("infotext", S("%s Idle"):format(machine_name))
hacky_swap_node(pos, "technic:hv_nuclear_reactor_core")
technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
elseif burn_time > 0 then
damage_nearby_players(pos)
if not check_reactor_structure(pos) then