From af23d3d2edee028e7fd4f38646f5828216bd1388 Mon Sep 17 00:00:00 2001 From: Super_ Date: Mon, 2 Nov 2020 21:24:25 -0500 Subject: [PATCH] fixed a silly --- .../java/me/totalfreedom/plex/command/impl/FionnCMD.java | 4 ++-- .../me/totalfreedom/plex/listener/impl/FreezeListener.java | 4 ++-- .../me/totalfreedom/plex/listener/impl/PlayerListener.java | 7 ++++--- src/main/java/me/totalfreedom/plex/player/PlexPlayer.java | 4 ---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/me/totalfreedom/plex/command/impl/FionnCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/FionnCMD.java index 9948442..5fedb84 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/FionnCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/FionnCMD.java @@ -76,7 +76,7 @@ public class FionnCMD extends PlexCommand p.setInvisible(true); LOCATION_CACHE.put(p, p.getLocation()); p.teleport(new Location(fionnWorld, 0, 5, 0, -90, 0)); - PlayerCache.getPlexPlayer(p.getUniqueId()).setFrozen(true); + PlayerCache.getPunishedPlayer(p.getUniqueId()).setFrozen(true); } lateFakeChat("elmon", "fionn! i'm sorry for not being your sex slave...", ChatColor.RED, 20); lateFakeChat("fionn", "it's too late for that now...", ChatColor.GREEN, 60); @@ -108,7 +108,7 @@ public class FionnCMD extends PlexCommand Location location = LOCATION_CACHE.get(p); if (location != null) p.teleport(location); - PlayerCache.getPlexPlayer(p.getUniqueId()).setFrozen(false); + PlayerCache.getPunishedPlayer(p.getUniqueId()).setFrozen(false); } LOCATION_CACHE.clear(); ENABLED = false; diff --git a/src/main/java/me/totalfreedom/plex/listener/impl/FreezeListener.java b/src/main/java/me/totalfreedom/plex/listener/impl/FreezeListener.java index ba21f99..e085f4a 100644 --- a/src/main/java/me/totalfreedom/plex/listener/impl/FreezeListener.java +++ b/src/main/java/me/totalfreedom/plex/listener/impl/FreezeListener.java @@ -2,7 +2,7 @@ package me.totalfreedom.plex.listener.impl; import me.totalfreedom.plex.cache.PlayerCache; import me.totalfreedom.plex.listener.PlexListener; -import me.totalfreedom.plex.player.PlexPlayer; +import me.totalfreedom.plex.player.PunishedPlayer; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerMoveEvent; @@ -11,7 +11,7 @@ public class FreezeListener extends PlexListener @EventHandler public void onPlayerMove(PlayerMoveEvent e) { - PlexPlayer player = PlayerCache.getPlexPlayer(e.getPlayer().getUniqueId()); + PunishedPlayer player = PlayerCache.getPunishedPlayer(e.getPlayer().getUniqueId()); if (player.isFrozen()) e.setCancelled(true); } diff --git a/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java b/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java index 43fa294..b0ac300 100644 --- a/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java +++ b/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java @@ -84,7 +84,7 @@ public class PlayerListener extends PlexListener } // saving the player's data - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerSave(PlayerQuitEvent event) { PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(event.getPlayer().getUniqueId()); //get the player because it's literally impossible for them to not have an object @@ -98,6 +98,9 @@ public class PlayerListener extends PlexListener sqlPlayerData.update(plexPlayer); } + if (FionnCMD.ENABLED) + PlayerCache.getPunishedPlayer(event.getPlayer().getUniqueId()).setFrozen(false); + PlayerCache.getPlexPlayerMap().remove(event.getPlayer().getUniqueId()); //remove them from cache PlayerCache.getPunishedPlayerMap().remove(event.getPlayer().getUniqueId()); } @@ -107,12 +110,10 @@ public class PlayerListener extends PlexListener public void onPlayerQuit(PlayerQuitEvent e) { Player player = e.getPlayer(); - PlexPlayer plexPlayer = PlayerCache.getPlexPlayer(player.getUniqueId()); if (FionnCMD.ENABLED) { player.setInvisible(false); - plexPlayer.setFrozen(false); Location location = FionnCMD.LOCATION_CACHE.get(player); if (location != null) player.teleport(location); diff --git a/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java b/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java index d53a13b..0f23062 100644 --- a/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java +++ b/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java @@ -39,8 +39,6 @@ public class PlexPlayer private List ips; - private boolean frozen; - public PlexPlayer() {} public PlexPlayer(UUID playerUUID) @@ -59,8 +57,6 @@ public class PlexPlayer this.ips = new ArrayList<>(); this.rank = ""; - - this.frozen = false; } public Rank getRankFromString()