mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2024-11-14 19:40:17 +01:00
Display probability in tool wear bar
This commit is contained in:
parent
6dbca794c9
commit
c740737a58
3
init.lua
3
init.lua
|
@ -552,6 +552,9 @@ schemedit.add_form("probtool", {
|
||||||
|
|
||||||
set_item_metadata(probtool, prob, force_place)
|
set_item_metadata(probtool, prob, force_place)
|
||||||
|
|
||||||
|
-- Repurpose the tool's wear bar to display the set probability
|
||||||
|
probtool:set_wear(math.floor(((255-prob)/255)*65535))
|
||||||
|
|
||||||
player:set_wielded_item(probtool)
|
player:set_wielded_item(probtool)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user