mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Cancel PlayerTeleportEvent for frozen players (closes #31)
This commit is contained in:
parent
d55de3b4a8
commit
e484130d84
@ -5,6 +5,7 @@ import dev.plex.listener.PlexListener;
|
|||||||
import dev.plex.player.PlexPlayer;
|
import dev.plex.player.PlexPlayer;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
public class FreezeListener extends PlexListener
|
public class FreezeListener extends PlexListener
|
||||||
{
|
{
|
||||||
@ -17,4 +18,14 @@ public class FreezeListener extends PlexListener
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerTeleport(PlayerTeleportEvent e)
|
||||||
|
{
|
||||||
|
PlexPlayer player = DataUtils.getPlayer(e.getPlayer().getUniqueId());
|
||||||
|
if (player.isFrozen())
|
||||||
|
{
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user