From 1368c2ef0014bb44caaa19965d0fd2b18a41af5e Mon Sep 17 00:00:00 2001 From: MCL Software Official Date: Sun, 19 Mar 2023 17:36:19 -0400 Subject: [PATCH] Drills should now have proper energy storage & consumption --- tools.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools.lua b/tools.lua index 11e81b3..b50a593 100644 --- a/tools.lua +++ b/tools.lua @@ -70,6 +70,11 @@ minetest.register_tool("industrialtest:drill", }, damage_groups = {cracky=3,crubmly=3,fleshy=3}, }, + after_use = + { + meta:set_int("industrialtest.powerAmount", math.max(meta:get_int("industrialtest.powerAmount") - 80,0)) + industrialtest.api.updateItemPowerText(itemstack) + } }) minetest.register_tool("industrialtest:drill_diamond", @@ -98,6 +103,12 @@ minetest.register_tool("industrialtest:drill_diamond", }, damage_groups = {cracky=3,crubmly=3,fleshy=3}, }, + + after_use = + { + meta:set_int("industrialtest.powerAmount", math.max(meta:get_int("industrialtest.powerAmount") - 80,0)) + industrialtest.api.updateItemPowerText(itemstack) + } }) if industrialtest.mtgAvailable then