forked from minetest-mods/nether
No wear out in creative and replace add_wear with add_wear_by_uses (#76)
This commit is contained in:
parent
a6d1f55f0a
commit
01b6f3c56d
|
@ -384,10 +384,11 @@ minetest.register_tool("nether:lightstaff_eternal", {
|
||||||
sound = {breaks = "default_tool_breaks"},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
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
|
-- The staff of Eternal Light wears out, to limit how much
|
||||||
-- a player can alter the nether with it.
|
-- 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
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user