mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27: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);
|
p.setInvisible(true);
|
||||||
LOCATION_CACHE.put(p, p.getLocation());
|
LOCATION_CACHE.put(p, p.getLocation());
|
||||||
p.teleport(new Location(fionnWorld, 0, 5, 0, -90, 0));
|
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("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);
|
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);
|
Location location = LOCATION_CACHE.get(p);
|
||||||
if (location != null)
|
if (location != null)
|
||||||
p.teleport(location);
|
p.teleport(location);
|
||||||
PlayerCache.getPlexPlayer(p.getUniqueId()).setFrozen(false);
|
PlayerCache.getPunishedPlayer(p.getUniqueId()).setFrozen(false);
|
||||||
}
|
}
|
||||||
LOCATION_CACHE.clear();
|
LOCATION_CACHE.clear();
|
||||||
ENABLED = false;
|
ENABLED = false;
|
||||||
|
@ -2,7 +2,7 @@ package me.totalfreedom.plex.listener.impl;
|
|||||||
|
|
||||||
import me.totalfreedom.plex.cache.PlayerCache;
|
import me.totalfreedom.plex.cache.PlayerCache;
|
||||||
import me.totalfreedom.plex.listener.PlexListener;
|
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.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ public class FreezeListener extends PlexListener
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent e)
|
public void onPlayerMove(PlayerMoveEvent e)
|
||||||
{
|
{
|
||||||
PlexPlayer player = PlayerCache.getPlexPlayer(e.getPlayer().getUniqueId());
|
PunishedPlayer player = PlayerCache.getPunishedPlayer(e.getPlayer().getUniqueId());
|
||||||
if (player.isFrozen())
|
if (player.isFrozen())
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public class PlayerListener extends PlexListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
// saving the player's data
|
// saving the player's data
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerSave(PlayerQuitEvent event)
|
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
|
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);
|
sqlPlayerData.update(plexPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FionnCMD.ENABLED)
|
||||||
|
PlayerCache.getPunishedPlayer(event.getPlayer().getUniqueId()).setFrozen(false);
|
||||||
|
|
||||||
PlayerCache.getPlexPlayerMap().remove(event.getPlayer().getUniqueId()); //remove them from cache
|
PlayerCache.getPlexPlayerMap().remove(event.getPlayer().getUniqueId()); //remove them from cache
|
||||||
PlayerCache.getPunishedPlayerMap().remove(event.getPlayer().getUniqueId());
|
PlayerCache.getPunishedPlayerMap().remove(event.getPlayer().getUniqueId());
|
||||||
}
|
}
|
||||||
@ -107,12 +110,10 @@ public class PlayerListener extends PlexListener
|
|||||||
public void onPlayerQuit(PlayerQuitEvent e)
|
public void onPlayerQuit(PlayerQuitEvent e)
|
||||||
{
|
{
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
PlexPlayer plexPlayer = PlayerCache.getPlexPlayer(player.getUniqueId());
|
|
||||||
|
|
||||||
if (FionnCMD.ENABLED)
|
if (FionnCMD.ENABLED)
|
||||||
{
|
{
|
||||||
player.setInvisible(false);
|
player.setInvisible(false);
|
||||||
plexPlayer.setFrozen(false);
|
|
||||||
Location location = FionnCMD.LOCATION_CACHE.get(player);
|
Location location = FionnCMD.LOCATION_CACHE.get(player);
|
||||||
if (location != null)
|
if (location != null)
|
||||||
player.teleport(location);
|
player.teleport(location);
|
||||||
|
@ -39,8 +39,6 @@ public class PlexPlayer
|
|||||||
|
|
||||||
private List<String> ips;
|
private List<String> ips;
|
||||||
|
|
||||||
private boolean frozen;
|
|
||||||
|
|
||||||
public PlexPlayer() {}
|
public PlexPlayer() {}
|
||||||
|
|
||||||
public PlexPlayer(UUID playerUUID)
|
public PlexPlayer(UUID playerUUID)
|
||||||
@ -59,8 +57,6 @@ public class PlexPlayer
|
|||||||
this.ips = new ArrayList<>();
|
this.ips = new ArrayList<>();
|
||||||
|
|
||||||
this.rank = "";
|
this.rank = "";
|
||||||
|
|
||||||
this.frozen = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rank getRankFromString()
|
public Rank getRankFromString()
|
||||||
|
Loading…
Reference in New Issue
Block a user