Also check for the players head locations when trying to teleport the player.
This commit is contained in:
		| @@ -52,16 +52,22 @@ public class PlayerMoveListener implements Listener | |||||||
| 		Gate gateAtLocation = gateManager.getGateAtLocation(event.getTo()); | 		Gate gateAtLocation = gateManager.getGateAtLocation(event.getTo()); | ||||||
|  |  | ||||||
| 		if (gateAtLocation == null) { | 		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()) { |         if (!gateAtLocation.isOpen()) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 		 | 		 | ||||||
|         System.out.println("player: " + event.getPlayer() + " location: " + event.getTo()); |  | ||||||
|  |  | ||||||
| 		 |  | ||||||
| 		// Check for permission | 		// Check for permission | ||||||
| 		if (!hasPermission(event.getPlayer(), gateAtLocation) | 		if (!hasPermission(event.getPlayer(), gateAtLocation) | ||||||
|             && Plugin.getPlugin().getConfig().getBoolean(Plugin.confShowTeleportNoPermissionMessageKey)) { |             && Plugin.getPlugin().getConfig().getBoolean(Plugin.confShowTeleportNoPermissionMessageKey)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Tobias Ottenweller
					Tobias Ottenweller