feat: change PlayerCache on ClientOptionChange
This commit is contained in:
parent
97a93c2cb0
commit
50f59d8000
1 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
||||||
|
package de.cliffbreak.varo.listeners;
|
||||||
|
|
||||||
|
import com.destroystokyo.paper.event.player.PlayerClientOptionsChangeEvent;
|
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
import de.cliffbreak.varo.Varo;
|
||||||
|
import de.cliffbreak.varo.PlayerCache.PlayerCacheType;
|
||||||
|
|
||||||
|
public class PlayerClientOptionsChangeListener implements Listener {
|
||||||
|
|
||||||
|
private Varo plugin;
|
||||||
|
|
||||||
|
public PlayerClientOptionsChangeListener(Varo plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler()
|
||||||
|
public void onPlayerClientOptionsChange(PlayerClientOptionsChangeEvent e) {
|
||||||
|
String uuid = e.getPlayer().getUniqueId().toString().replace("-", "");
|
||||||
|
plugin.playerCache.setPlayerCache(uuid, PlayerCacheType.SKINPARTS, e.getSkinParts().getRaw());
|
||||||
|
plugin.playerCache.setPlayerCache(uuid, PlayerCacheType.MAINHAND, e.getMainHand().toString());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue