diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-01-06 21:47:06 -0700 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-01-06 21:47:06 -0700 |
commit | 1789316ec540fb30f8ab10ebe406048a78bad5bf (patch) | |
tree | ba4684631a8ebfce7d610fbf04f5506ef5411a69 /util.lua | |
parent | 4b5eb1b865108207c7fcd04e34e249583be1b711 (diff) |
Added Pipeworks compatibility
Diffstat (limited to 'util.lua')
-rw-r--r-- | util.lua | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -98,9 +98,13 @@ end digtron.move_node = function(pos, newpos, player_name) -- Moves nodes, preserving digtron metadata and inventory local node = minetest.get_node(pos) + local node_def = minetest.registered_nodes[node.name] local oldnode = minetest.get_node(newpos) minetest.log("action", string.format("%s moves %s from (%d, %d, %d) to (%d, %d, %d), displacing %s", player_name, node.name, pos.x, pos.y, pos.z, newpos.x, newpos.y, newpos.z, oldnode.name)) minetest.add_node(newpos, { name=node.name, param1=node.param1, param2=node.param2 }) + if node_def.after_place_node then + node_def.after_place_node(newpos) + end local oldmeta = minetest.get_meta(pos) local oldinv = oldmeta:get_inventory() @@ -122,12 +126,16 @@ digtron.move_node = function(pos, newpos, player_name) newmeta:set_float("fuel_burning", oldmeta:get_float("fuel_burning")) newmeta:set_string("infotext", oldmeta:get_string("infotext")) + -- Move the little floaty entity inside the builders if minetest.get_item_group(node.name, "digtron") == 4 then digtron.update_builder_item(newpos) end -- remove node from old position minetest.remove_node(pos) + if node_def.after_dig_node then + node_def.after_dig_node(pos) + end end digtron.get_all_digtron_neighbours = function(pos, player) |