Search in sources :

Example 16 with ConquerPlayer

use of me.andrew28.addons.conquer.api.ConquerPlayer in project Conquer by xXAndrew28Xx.

the class EffInvitePlayer method execute.

@Override
protected void execute(Event e) {
    ConquerPlayer[] players = this.players.getArray(e);
    ConquerFaction[] factions = this.factions.getArray(e);
    if (players == null || factions == null) {
        return;
    }
    for (ConquerPlayer player : players) {
        if (player == null) {
            continue;
        }
        for (ConquerFaction faction : factions) {
            if (faction == null) {
                continue;
            }
            if (invite) {
                faction.invite(player);
            } else {
                faction.deinvite(player);
            }
        }
    }
}
Also used : ConquerFaction(me.andrew28.addons.conquer.api.ConquerFaction) ConquerPlayer(me.andrew28.addons.conquer.api.ConquerPlayer)

Aggregations

ConquerPlayer (me.andrew28.addons.conquer.api.ConquerPlayer)16 ConquerFaction (me.andrew28.addons.conquer.api.ConquerFaction)11 EventHandler (org.bukkit.event.EventHandler)7 ConquerFactionRelationWishEvent (me.andrew28.addons.conquer.api.events.ConquerFactionRelationWishEvent)4 ConquerPowerLossEvent (me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent)4 Relation (me.andrew28.addons.conquer.api.Relation)3 ConquerFactionRelationEvent (me.andrew28.addons.conquer.api.events.ConquerFactionRelationEvent)3 ConquerLandClaimEvent (me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent)3 HashSet (java.util.HashSet)2 Map (java.util.Map)2 ConquerFactionCreateEvent (me.andrew28.addons.conquer.api.events.ConquerFactionCreateEvent)2 ConquerFactionDisbandEvent (me.andrew28.addons.conquer.api.events.ConquerFactionDisbandEvent)2 ConquerFactionJoinEvent (me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent)2 ConquerFactionLeaveEvent (me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent)2 ConquerUnclaimAllEvent (me.andrew28.addons.conquer.api.events.ConquerUnclaimAllEvent)2 Cancellable (org.bukkit.event.Cancellable)2 Event (org.bukkit.event.Event)2 Date (ch.njol.skript.util.Date)1 EventFactionsChunkChangeType (com.massivecraft.factions.event.EventFactionsChunkChangeType)1 EventFactionsChunksChange (com.massivecraft.factions.event.EventFactionsChunksChange)1