mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-04 14:03:24 +01:00
Extend MinepacksPlayerJoinEvent
This commit is contained in:
parent
3d887db3cb
commit
d598ad0c2a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 GeorgH93
|
||||
* Copyright (C) 2021 GeorgH93
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -33,6 +34,7 @@
|
||||
public class MinepacksPlayerJoinEvent extends Event
|
||||
{
|
||||
@Getter private final MinepacksPlayer player;
|
||||
@Getter private final Player bukkitPlayer;
|
||||
|
||||
//region Bukkit handler stuff
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
@ -168,7 +168,7 @@ public void onPlayerLoginEvent(final @NotNull PlayerJoinEvent event)
|
||||
getPlayer(event.getPlayer()) // Trigger player data prefetch
|
||||
.notifyOnLoad(player -> { // Trigger MinepacksPlayerJoinEvent
|
||||
if(player.isOnline())
|
||||
Bukkit.getPluginManager().callEvent(new MinepacksPlayerJoinEvent(player));
|
||||
Bukkit.getPluginManager().callEvent(new MinepacksPlayerJoinEvent(player, event.getPlayer()));
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user