package net.simpvp.Portals;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;

public class PlayerInteract implements Listener {

	@EventHandler
	public void onPlayerInteract(PlayerInteractEvent event) {
		
		if (event.getAction() == Action.PHYSICAL) {
			
			Player player = event.getPlayer();	
			Block block = event.getClickedBlock();
			
			/* Other pressure plates seem to send multiple events when stepped on so only use wood and stone */
			if (block.getType() != Material.STONE_PLATE && block.getType() != Material.WOOD_PLATE) {
				return;
			}
			
			if (PortalCheck.is_valid_portal(block)) {
				Portals.instance.getLogger().info(player.getName() + " tried to use a portal by pressure plate at"
						+ " " + block.getWorld().getName()
						+ " " + block.getX()
						+ " " + block.getY()
						+ " " + block.getZ()
						+ ".");
				PortalUtils.teleport(player, block.getLocation());
			}
		}
	}

}

@@ -402,18 +402,16 @@
 vent) %7B%0A
-%09%09
 %0A%09%09if (e
@@ -449,19 +449,16 @@
 ICAL) %7B%0A
-%09%09%09
 %0A%09%09%09Play
@@ -531,19 +531,16 @@
 lock();%0A
-%09%09%09
 %0A%09%09%09/* O
@@ -748,19 +748,16 @@
 %09%09%7D%0A
-%09%09%09
 %0A%09%09%09if (
 Port
@@ -752,16 +752,17 @@
 %0A%09%09%09if (
+!
 PortalCh
@@ -790,17 +790,231 @@
 lock)) %7B
+%09
 %0A
+%09%09%09%09return;%0A%09%09%09%7D%0A%0A%09%09%09/* Short delay to stop players from teleporting to the wrong loation */%0A%09%09%09Portals.instance.getServer().getScheduler().runTaskLater(Portals.instance, new Runnable() %7B%0A%09%09%09%09public void run() %7B%0A%09
 %09%09%09%09Port
@@ -1108,16 +1108,17 @@
 ate at%22%0A
+%09
 %09%09%09%09%09%09+ 
@@ -1148,32 +1148,33 @@
 getName()%0A%09%09%09%09%09%09
+%09
 + %22 %22 + block.ge
@@ -1178,16 +1178,17 @@
 .getX()%0A
+%09
 %09%09%09%09%09%09+ 
@@ -1206,16 +1206,17 @@
 .getY()%0A
+%09
 %09%09%09%09%09%09+ 
@@ -1244,16 +1244,17 @@
 %09%09%09%09
+%09
 + %22.%22);%0A
 %09%09%09%09
@@ -1249,16 +1249,17 @@
 + %22.%22);%0A
+%09
 %09%09%09%09Port
@@ -1312,16 +1312,28 @@
 %0A%09%09%09
-%7D
+%09%7D%0A%09%09%09%7D, 1L);
 %0A%09%09%7D%0A%09%7D%0A
 %0A%7D%0A
@@ -1329,11 +1329,10 @@
 %0A%09%09%7D%0A%09%7D%0A
-%0A
 %7D%0A

Fix incorrect teleport issues