diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-14 19:57:34 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-14 20:00:46 +0100 |
commit | cd9102cef16e92a8c5b157a1708194ef2ad773d0 (patch) | |
tree | cb185378f04d24779a419ca8d29cb4f8b673bce6 | |
parent | eefcbc1e86409672037b77bb65afaed98721c202 (diff) | |
download | pipeworks-cd9102cef16e92a8c5b157a1708194ef2ad773d0.tar pipeworks-cd9102cef16e92a8c5b157a1708194ef2ad773d0.tar.gz pipeworks-cd9102cef16e92a8c5b157a1708194ef2ad773d0.tar.bz2 pipeworks-cd9102cef16e92a8c5b157a1708194ef2ad773d0.tar.xz pipeworks-cd9102cef16e92a8c5b157a1708194ef2ad773d0.zip |
wielder.lua: add LBM to refund mese picks for pre-transition node breakers
-rw-r--r-- | wielder.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/wielder.lua b/wielder.lua index 8f2b2a2..51ee278 100644 --- a/wielder.lua +++ b/wielder.lua @@ -302,14 +302,17 @@ end if pipeworks.enable_node_breaker then local data + -- see after end of data table for other use of these variables + local name_base = "pipeworks:nodebreaker" + local wield_inv_name = "pick" data = { - name_base = "pipeworks:nodebreaker", + name_base = name_base, description = "Node Breaker", texture_base = "pipeworks_nodebreaker", texture_stateful = { top = true, bottom = true, side2 = true, side1 = true, front = true }, tube_connect_sides = { top=1, bottom=1, left=1, right=1, back=1 }, tube_permit_anteroposterior_insert = false, - wield_inv_name = "pick", + wield_inv_name = wield_inv_name, wield_inv_width = 1, wield_inv_height = 1, can_dig_nonempty_wield_inv = true, @@ -421,6 +424,20 @@ if pipeworks.enable_node_breaker then minetest.register_alias("technic:node_breaker_on", "pipeworks:nodebreaker_on") -- turn legacy auto-tree-taps into node breakers dofile(pipeworks.modpath.."/legacy.lua") + + -- register LBM for transition to cheaper node breakers + local lbm_id = "pipeworks:refund_node_breaker_pick" + minetest.register_lbm({ + name = lbm_id, + label = "Give back mese pick for pre-transition node breakers", + run_at_every_load = false, + nodenames = { name_base.."_on", name_base.."_off" }, + action = function(pos, node) + pipeworks.logger(lbm_id.." entry, nodename="..node.name) + local invref = minetest.get_meta(pos):get_inventory() + invref:add_item(wield_inv_name, ItemStack("default:pick_mese")) + end + }) end if pipeworks.enable_deployer then |