CSL is overriding in-game change skin packets
AchiraE opened this issue ยท 2 comments
Description
I have an RPG server that heavily relies on in-game skin changes. The skin change is done by setting the player's GameProfile and sending some refresh packets. This mechanism works for most of the players, regardless of online/offline mode or Mojang/offline accounts.
However, if the player has the CustomSkinLoader Mod installed, CSL will override all the skin packets, so their skins will always remain unchanged.
Expected behavior
CSL should only set the player's skin during login. Subsequent in-game changes of skin should not be overridden.
Notes
The change of skin is done by Paper's Player#setPlayerProfile
. (Or the following three packets, if you prefer a packet-level view).
- remove the player (Player Info Packet)
- add the player with new GameProfile(new skin texture) (Player Info Packet)
- respawn the player in-place (Respawn Packet)
Theoretically speaking, this problem is caused by too long cache invalidation time.
When the player respawns, the CustomSkinLoader will request the skin again - this was confirmed when I played pvp servers before.
CustomSkinLoader sets a default cache time of 30 seconds to avoid too many requests for skin sites. If the player respawn interval is less than the set cache time, then the old skin will be used. You can modify this time in the config file (.minecraft/CustomSkinLoader/CustomSkinLoader.json
-> cacheExpiry
). Setting cacheExpiry
to a value less than -5 means that the caching of the requested skin is completely disabled.