mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Add wear bar color API (#13328)
--------- Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com> Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com> Co-authored-by: grorp <gregor.parzefall@posteo.de>
This commit is contained in:
parent
e10d8080ba
commit
176e674a51
19 changed files with 598 additions and 26 deletions
|
@ -210,6 +210,29 @@ minetest.register_chatcommand("dump_item", {
|
|||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("dump_itemdef", {
|
||||
params = "",
|
||||
description = "Prints a dump of the wielded item's definition in table form",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local str = dump(player:get_wielded_item():get_definition())
|
||||
print(str)
|
||||
return true, str
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("dump_wear_bar", {
|
||||
params = "",
|
||||
description = "Prints a dump of the wielded item's wear bar parameters in table form",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local item = player:get_wielded_item()
|
||||
local str = dump(item:get_wear_bar_params())
|
||||
print(str)
|
||||
return true, str
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("set_saturation", {
|
||||
params = "<saturation>",
|
||||
description = "Set the saturation for current player.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue