mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 12:25:46 +01:00
Add an online check for teleport listener
- Some plugins seem to like teleport players before they're online (e.g. NoCheatPlus) - Addresses #3142
This commit is contained in:
parent
991703914c
commit
b9cb6842e2
@ -383,6 +383,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onTeleport(PlayerTeleportEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
//We need to account for bad plugins like NoCheatPlus that teleports player on/before login -_-
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||
try (final MetaDataAccess<Plot> lastPlotAccess =
|
||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
||||
|
Loading…
Reference in New Issue
Block a user