#729 Make FirstSpawn event synchronous

This commit is contained in:
ljacqu 2016-06-13 19:19:00 +02:00
parent 58278a2bbe
commit d5ce172e14
2 changed files with 5 additions and 17 deletions

View File

@ -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;
}
/**

View File

@ -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);
}
/**