From 01b6f3c56d9a22214b819da7ee8e1e5d25768011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Tue, 21 May 2024 01:22:39 +0700 Subject: [PATCH] No wear out in creative and replace add_wear with add_wear_by_uses (#76) --- tools.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools.lua b/tools.lua index 740bf83..9616b8a 100644 --- a/tools.lua +++ b/tools.lua @@ -384,10 +384,11 @@ minetest.register_tool("nether:lightstaff_eternal", { sound = {breaks = "default_tool_breaks"}, stack_max = 1, on_use = function(itemstack, user, pointed_thing) - if lightstaff_on_use(user, "#23F", 0) then -- was "#8088FF" or "#13F" + if lightstaff_on_use(user, "#23F", 0) -- was "#8088FF" or "#13F" + and not minetest.is_creative_enabled(user) then -- The staff of Eternal Light wears out, to limit how much -- a player can alter the nether with it. - itemstack:add_wear(65535 / (nether.lightstaff_uses - 1)) + itemstack:add_wear_by_uses(nether.lightstaff_uses) end return itemstack end