From d5ce172e1435c0cd8e0ad9de9dae46a5942b3adf Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 13 Jun 2016 19:19:00 +0200 Subject: [PATCH] #729 Make FirstSpawn event synchronous --- .../authme/events/AbstractTeleportEvent.java | 20 ++++--------------- .../events/FirstSpawnTeleportEvent.java | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/main/java/fr/xephi/authme/events/AbstractTeleportEvent.java b/src/main/java/fr/xephi/authme/events/AbstractTeleportEvent.java index 57a456b6..51d366d9 100644 --- a/src/main/java/fr/xephi/authme/events/AbstractTeleportEvent.java +++ b/src/main/java/fr/xephi/authme/events/AbstractTeleportEvent.java @@ -19,25 +19,13 @@ public abstract class AbstractTeleportEvent extends CustomEvent implements Cance * * @param isAsync Whether to fire the event asynchronously or not * @param player The player - * @param from The location the player is being teleported away from - * @param to The teleport destination - */ - public AbstractTeleportEvent(boolean isAsync, Player player, Location from, Location to) { - super(isAsync); - this.player = player; - this.from = from; - this.to = to; - } - - /** - * Constructor, using the player's current location as "from" location. - * - * @param isAsync Whether to fire the event asynchronously or not - * @param player The player * @param to The teleport destination */ public AbstractTeleportEvent(boolean isAsync, Player player, Location to) { - this(isAsync, player, player.getLocation(), to); + super(isAsync); + this.player = player; + this.from = player.getLocation(); + this.to = to; } /** diff --git a/src/main/java/fr/xephi/authme/events/FirstSpawnTeleportEvent.java b/src/main/java/fr/xephi/authme/events/FirstSpawnTeleportEvent.java index 6a90e5dd..e5e6868d 100644 --- a/src/main/java/fr/xephi/authme/events/FirstSpawnTeleportEvent.java +++ b/src/main/java/fr/xephi/authme/events/FirstSpawnTeleportEvent.java @@ -20,7 +20,7 @@ public class FirstSpawnTeleportEvent extends AbstractTeleportEvent { * @param to The teleport destination */ public FirstSpawnTeleportEvent(Player player, Location to) { - super(true, player, to); + super(false, player, to); } /**