Extend MinepacksPlayerJoinEvent

This commit is contained in:
GeorgH93 2021-05-24 00:00:45 +02:00
parent 3d887db3cb
commit d598ad0c2a
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
2 changed files with 4 additions and 2 deletions

View File

@ -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();

View File

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