Also check for the players head locations when trying to teleport the player.

This commit is contained in:
Tobias Ottenweller 2013-06-23 18:46:03 +02:00
parent f4495240a5
commit ea52e4d87e

View File

@ -52,16 +52,22 @@ public class PlayerMoveListener implements Listener
Gate gateAtLocation = gateManager.getGateAtLocation(event.getTo());
if (gateAtLocation == null) {
return;
Location headTo = new Location(event.getTo().getWorld(),
event.getTo().getX(),
event.getTo().getY()+1.0,
event.getTo().getZ());
gateAtLocation = gateManager.getGateAtLocation(headTo);
if (gateAtLocation == null) {
return;
}
}
if (!gateAtLocation.isOpen()) {
return;
}
System.out.println("player: " + event.getPlayer() + " location: " + event.getTo());
// Check for permission
if (!hasPermission(event.getPlayer(), gateAtLocation)
&& Plugin.getPlugin().getConfig().getBoolean(Plugin.confShowTeleportNoPermissionMessageKey)) {