mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-16 07:35:23 +01:00
parent
16ea4625c9
commit
8ffc81ad74
@ -350,6 +350,11 @@ public void onItemHeldChange(PlayerItemHeldEvent event) {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onPlayerTeleport(PlayerTeleportEvent event) {
|
||||
if (event.getTo() == null) {
|
||||
// The target location for PlayerTeleportEvents can be null.
|
||||
// Those events will be ignored by the server, so we can ignore them too.
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
if (com.sk89q.worldguard.bukkit.util.Entities.isNPC(player)) return;
|
||||
LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
|
||||
|
Loading…
Reference in New Issue
Block a user