mirror of
https://github.com/minetest-mods/technic.git
synced 2025-06-30 23:30:38 +02:00
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:
@ -81,6 +81,11 @@ minetest.register_tool("technic:water_can", {
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
on_refill = function(stack)
|
||||
stack:set_metadata(tostring(water_can_max_load))
|
||||
set_can_wear(stack, water_can_max_load, water_can_max_load)
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("technic:lava_can", {
|
||||
@ -131,5 +136,10 @@ minetest.register_tool("technic:lava_can", {
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
on_refill = function(stack)
|
||||
stack:set_metadata(tostring(lava_can_max_load))
|
||||
set_can_wear(stack, lava_can_max_load, lava_can_max_load)
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user