mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-12-05 11:44:15 +01:00
Updated warp event code and stopped on stopped move events
This commit is contained in:
parent
14a453ea1a
commit
72db55a86b
@ -100,7 +100,7 @@ public class Listeners implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onMoveEvent(PlayerMoveEvent event) {
|
public void onMoveEvent(PlayerMoveEvent event) {
|
||||||
// will check if the player is in the portal or not.
|
// will check if the player is in the portal or not.
|
||||||
if (!Portal.portalsActive) {
|
if (!Portal.portalsActive || event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ public class Listeners implements Listener {
|
|||||||
WarpEvent warpEvent = new WarpEvent(player, portal);
|
WarpEvent warpEvent = new WarpEvent(player, portal);
|
||||||
plugin.getServer().getPluginManager().callEvent(warpEvent);
|
plugin.getServer().getPluginManager().callEvent(warpEvent);
|
||||||
|
|
||||||
if (!event.isCancelled()) Portal.activate(player, portal);
|
if (!warpEvent.isCancelled()) Portal.activate(player, portal);
|
||||||
|
|
||||||
portal.inPortal.add(player);
|
portal.inPortal.add(player);
|
||||||
} else portal.inPortal.remove(player);
|
} else portal.inPortal.remove(player);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user