Search in sources :

Example 1 with GDClanPlayer

use of com.griefdefender.hooks.provider.clan.uclans.GDClanPlayer in project GDHooks by bloodmc.

the class UClansEventHandler method onClanPlayerJoin.

@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onClanPlayerJoin(ClanGlobalEvent event) {
    if (ClanEvents.PLAYERJOIN != event.getEvent()) {
        return;
    }
    final Player player = Bukkit.getPlayer(event.getSender());
    if (player == null) {
        return;
    }
    final World world = player.getWorld();
    if (!GriefDefender.getCore().isEnabled(world.getUID())) {
        return;
    }
    ((UClansProvider) GDHooks.getInstance().getClanProvider()).getClanPlayerMap().put(player.getUniqueId(), new GDClanPlayer(this.plugin.getPlayerAPI().getPlayerData(player.getUniqueId())));
}
Also used : ClanPlayer(com.griefdefender.api.ClanPlayer) Player(org.bukkit.entity.Player) GDClanPlayer(com.griefdefender.hooks.provider.clan.uclans.GDClanPlayer) GDClanPlayer(com.griefdefender.hooks.provider.clan.uclans.GDClanPlayer) World(org.bukkit.World) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ClanPlayer (com.griefdefender.api.ClanPlayer)1 GDClanPlayer (com.griefdefender.hooks.provider.clan.uclans.GDClanPlayer)1 World (org.bukkit.World)1 Player (org.bukkit.entity.Player)1 EventHandler (org.bukkit.event.EventHandler)1