forked from Upstream/mmocore
!fixed AsyncPlayerDataLoadEvent
This commit is contained in:
parent
40fdcc4f28
commit
4f1084f80e
@ -0,0 +1,29 @@
|
||||
package net.Indyuce.mmocore.api.event;
|
||||
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* In order to create bukkit async events we must call
|
||||
* the right constructor:
|
||||
* <p>
|
||||
* {@link Event#Event(boolean)} and have the boolean set to true
|
||||
*/
|
||||
public abstract class AsyncPlayerDataEvent extends Event {
|
||||
private final PlayerData playerData;
|
||||
|
||||
public AsyncPlayerDataEvent(PlayerData playerData) {
|
||||
super(true);
|
||||
|
||||
this.playerData = playerData;
|
||||
}
|
||||
|
||||
public PlayerData getData() {
|
||||
return playerData;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return playerData.getPlayer();
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ package net.Indyuce.mmocore.api.event;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class AsyncPlayerDataLoadEvent extends PlayerDataEvent {
|
||||
public class AsyncPlayerDataLoadEvent extends AsyncPlayerDataEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user