Refill behaviour for power tools and cans

Supply the on_refill hook for power tools and cans, to perform appropriate
charging.  This is to be used by unified_inventory's creative-mode
refill slot.
This commit is contained in:
Zefram
2014-04-30 10:49:54 +01:00
parent 0294fc8f3a
commit 00d7c9bdea
9 changed files with 34 additions and 0 deletions

View File

@ -256,6 +256,7 @@ minetest.register_tool("technic:chainsaw", {
inventory_image = "technic_chainsaw.png",
stack_max = 1,
wear_represents = "technic_RE_charge",
on_refill = technic.refill_RE_charge,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack