Check to see if the events are canceled for onPlayerMove() and onPlayerInteract()

Make sure that the events are not canceled. Region protection plugins will cancel
events if a player is not authorized to be there.
This commit is contained in:
Stefan Bossbaly 2012-04-21 22:17:12 -03:00
parent 8ad6ab57ad
commit 5a872f3c86

View File

@ -719,6 +719,7 @@ public class Stargate extends JavaPlugin {
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
if (event.isCancelled()) return;
Player player = event.getPlayer();
Portal portal = Portal.getByEntrance(event.getTo());
@ -782,6 +783,7 @@ public class Stargate extends JavaPlugin {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.isCancelled()) return;
Player player = event.getPlayer();
Block block = event.getClickedBlock();