mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2025-04-22 20:10:21 +02: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)
|
||||
|
||||
-- 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)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user