mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
fixed a silly
This commit is contained in:
parent
57dbafb385
commit
af23d3d2ed
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -39,8 +39,6 @@ public class PlexPlayer
|
||||
|
||||
private List<String> 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()
|
||||
|
Loading…
Reference in New Issue
Block a user