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:
parent
8ad6ab57ad
commit
5a872f3c86
@ -719,6 +719,7 @@ public class Stargate extends JavaPlugin {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
|
if (event.isCancelled()) return;
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Portal portal = Portal.getByEntrance(event.getTo());
|
Portal portal = Portal.getByEntrance(event.getTo());
|
||||||
|
|
||||||
@ -782,6 +783,7 @@ public class Stargate extends JavaPlugin {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
if (event.isCancelled()) return;
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user