mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 13:57:49 +01:00
Add another safeguard for interworld teleports
This commit is contained in:
parent
2fafc0a75d
commit
df80b3c66a
@ -9,6 +9,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPortalEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
@ -80,7 +81,7 @@ public class MovingCheckListener implements Listener, EventManager {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void teleport(final PlayerTeleportEvent event) {
|
||||
|
||||
|
||||
NoCheatPlayer player = plugin.getPlayer(event.getPlayer());
|
||||
final MovingData data = MovingCheck.getData(player.getDataStore());
|
||||
|
||||
@ -99,6 +100,14 @@ public class MovingCheckListener implements Listener, EventManager {
|
||||
return;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void worldChange(final PlayerChangedWorldEvent event) {
|
||||
final MovingData data = MovingCheck.getData(plugin.getPlayer(event.getPlayer()).getDataStore());
|
||||
data.teleportTo.reset();
|
||||
data.clearRunFlyData();
|
||||
data.clearMorePacketsData();
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void portal(final PlayerPortalEvent event) {
|
||||
final MovingData data = MovingCheck.getData(plugin.getPlayer(event.getPlayer()).getDataStore());
|
||||
|
Loading…
Reference in New Issue
Block a user