mirror of
https://github.com/minetest-mods/nether.git
synced 2024-12-28 11:50:26 +01:00
tools.lua localise math
localise math function
This commit is contained in:
parent
1f3630e047
commit
5501da83da
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
local S = nether.get_translator
|
local S = nether.get_translator
|
||||||
|
|
||||||
|
local math_floor = math.floor -- localise math function
|
||||||
|
|
||||||
minetest.register_tool("nether:pick_nether", {
|
minetest.register_tool("nether:pick_nether", {
|
||||||
description = S("Nether Pickaxe\nWell suited for mining netherrack"),
|
description = S("Nether Pickaxe\nWell suited for mining netherrack"),
|
||||||
_doc_items_longdesc = S("Uniquely suited for mining netherrack, with minimal wear when doing so. Blunts quickly on other materials."),
|
_doc_items_longdesc = S("Uniquely suited for mining netherrack, with minimal wear when doing so. Blunts quickly on other materials."),
|
||||||
@ -43,7 +45,7 @@ minetest.register_tool("nether:pick_nether", {
|
|||||||
wearDivisor = 1 + (3 * workable) -- 10 for netherrack, 1 otherwise. Making it able to mine 350 netherrack nodes, instead of 35.
|
wearDivisor = 1 + (3 * workable) -- 10 for netherrack, 1 otherwise. Making it able to mine 350 netherrack nodes, instead of 35.
|
||||||
end
|
end
|
||||||
|
|
||||||
local wear = math.floor(digparams.wear / wearDivisor)
|
local wear = math_floor(digparams.wear / wearDivisor)
|
||||||
itemstack:add_wear(wear) -- apply the adjusted wear as usual
|
itemstack:add_wear(wear) -- apply the adjusted wear as usual
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user