Use cache for toggling commandspy

This commit is contained in:
Telesphoreo 2022-11-26 04:24:52 -06:00
parent 76952e33b8
commit ed638679b2
No known key found for this signature in database
GPG Key ID: B5CDDEBA526C0130

View File

@ -22,7 +22,7 @@ public class CommandSpyCMD extends PlexCommand
{ {
if (playerSender != null) if (playerSender != null)
{ {
PlexPlayer plexPlayer = DataUtils.getPlayer(playerSender.getUniqueId()); PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayer(playerSender.getUniqueId());
plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy()); plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy());
DataUtils.update(plexPlayer); DataUtils.update(plexPlayer);
send(sender, messageComponent("toggleCommandSpy") send(sender, messageComponent("toggleCommandSpy")