Improve API for third party mods (#21)

* Add `armor:update_skin(player_name)` function (useful for skin mods)
* Add option to prevent physics override (useful for Techage Jetpack mod)
* Add documentation
This commit is contained in:
Thomas--S
2020-10-12 07:47:57 +02:00
committed by GitHub
parent 3f1a952afb
commit 7436fcdffe
3 changed files with 24 additions and 9 deletions

View File

@ -172,6 +172,10 @@ armor:unequip(player, armor_name)
Unequip the armor, adding the itemstack to the main inventory.
armor:update_skin(player_name)
Triggers a skin update with the same action as if a field with `skins_set` was submitted.
Item Callbacks:
on_equip = func(player, index, stack)
@ -201,3 +205,8 @@ armor:register_on_update(function(player)
print(player:get_player_name().." armor updated!")
end)
Note:
The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1
in the respective player's meta.