Search in sources :

Example 1 with ConquerFactionJoinEvent

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

the class LFEventForwarder method onFactionsChange.

@EventHandler
public void onFactionsChange(EventFactionsChange event) {
    Event forwardEvent;
    if (event.getFactionNew().isWilderness()) {
        forwardEvent = new ConquerFactionLeaveEvent(LFFaction.get(plugin, event.getFactionOld()), LFPlayer.get(plugin, event.getFPlayer()));
    } else {
        forwardEvent = new ConquerFactionJoinEvent(LFFaction.get(plugin, event.getFactionNew()), LFPlayer.get(plugin, event.getFPlayer()));
    }
    callEvent(forwardEvent);
    if (((Cancellable) forwardEvent).isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) Cancellable(org.bukkit.event.Cancellable) Event(org.bukkit.event.Event) ConquerFactionRelationEvent(me.andrew28.addons.conquer.api.events.ConquerFactionRelationEvent) ConquerFactionLeaveEvent(me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent) ConquerPowerLossEvent(me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent) ConquerFactionDisbandEvent(me.andrew28.addons.conquer.api.events.ConquerFactionDisbandEvent) ConquerFactionRelationWishEvent(me.andrew28.addons.conquer.api.events.ConquerFactionRelationWishEvent) ConquerLandClaimEvent(me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent) ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) ConquerFactionCreateEvent(me.andrew28.addons.conquer.api.events.ConquerFactionCreateEvent) ConquerFactionLeaveEvent(me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent) EventHandler(org.bukkit.event.EventHandler)

Example 2 with ConquerFactionJoinEvent

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

the class MSEventForwarder method onMembershipChange.

@EventHandler
public void onMembershipChange(EventFactionsMembershipChange event) {
    ConquerFaction faction = MSFaction.get(plugin, event.getNewFaction());
    ConquerPlayer player = MSPlayer.get(plugin, event.getMPlayer());
    Event forwardEvent;
    switch(event.getReason()) {
        case JOIN:
        case CREATE:
            forwardEvent = new ConquerFactionJoinEvent(faction, player);
            break;
        case LEAVE:
        case KICK:
        case DISBAND:
            forwardEvent = new ConquerFactionLeaveEvent(faction, player);
            break;
        default:
            return;
    }
    callEvent(forwardEvent);
    if (((Cancellable) forwardEvent).isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerFaction(me.andrew28.addons.conquer.api.ConquerFaction) ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) Cancellable(org.bukkit.event.Cancellable) ConquerUnclaimAllEvent(me.andrew28.addons.conquer.api.events.ConquerUnclaimAllEvent) Event(org.bukkit.event.Event) ConquerFactionRelationEvent(me.andrew28.addons.conquer.api.events.ConquerFactionRelationEvent) ConquerFactionLeaveEvent(me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent) ConquerPowerLossEvent(me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent) ConquerFactionDisbandEvent(me.andrew28.addons.conquer.api.events.ConquerFactionDisbandEvent) ConquerFactionRelationWishEvent(me.andrew28.addons.conquer.api.events.ConquerFactionRelationWishEvent) ConquerLandClaimEvent(me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent) ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) ConquerFactionCreateEvent(me.andrew28.addons.conquer.api.events.ConquerFactionCreateEvent) ConquerPlayer(me.andrew28.addons.conquer.api.ConquerPlayer) ConquerFactionLeaveEvent(me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent) EventHandler(org.bukkit.event.EventHandler)

Example 3 with ConquerFactionJoinEvent

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

the class SFEventForwarder method onJoin.

@EventHandler
public void onJoin(FPlayerJoinEvent event) {
    ConquerFactionJoinEvent forwardEvent = new ConquerFactionJoinEvent(SFFaction.get(plugin, event.getFaction()), SFPlayer.get(plugin, event.getfPlayer()));
    callEvent(forwardEvent);
    if (forwardEvent.isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) EventHandler(org.bukkit.event.EventHandler)

Example 4 with ConquerFactionJoinEvent

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

the class FOEventForwarder method onJoin.

@EventHandler
public void onJoin(FPlayerJoinEvent event) {
    ConquerFactionJoinEvent forwardEvent = new ConquerFactionJoinEvent(FOFaction.get(plugin, event.getFaction()), FOPlayer.get(plugin, event.getFPlayer()));
    callEvent(forwardEvent);
    if (forwardEvent.isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) EventHandler(org.bukkit.event.EventHandler)

Example 5 with ConquerFactionJoinEvent

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

the class FUEventForwarder method onJoin.

@EventHandler
public void onJoin(FPlayerJoinEvent event) {
    ConquerFactionJoinEvent forwardEvent = new ConquerFactionJoinEvent(FUFaction.get(plugin, event.getFaction()), FUPlayer.get(plugin, event.getfPlayer()));
    callEvent(forwardEvent);
    if (forwardEvent.isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerFactionJoinEvent(me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ConquerFactionJoinEvent (me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent)5 EventHandler (org.bukkit.event.EventHandler)5 ConquerFactionCreateEvent (me.andrew28.addons.conquer.api.events.ConquerFactionCreateEvent)2 ConquerFactionDisbandEvent (me.andrew28.addons.conquer.api.events.ConquerFactionDisbandEvent)2 ConquerFactionLeaveEvent (me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent)2 ConquerFactionRelationEvent (me.andrew28.addons.conquer.api.events.ConquerFactionRelationEvent)2 ConquerFactionRelationWishEvent (me.andrew28.addons.conquer.api.events.ConquerFactionRelationWishEvent)2 ConquerLandClaimEvent (me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent)2 ConquerPowerLossEvent (me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent)2 Cancellable (org.bukkit.event.Cancellable)2 Event (org.bukkit.event.Event)2 ConquerFaction (me.andrew28.addons.conquer.api.ConquerFaction)1 ConquerPlayer (me.andrew28.addons.conquer.api.ConquerPlayer)1 ConquerUnclaimAllEvent (me.andrew28.addons.conquer.api.events.ConquerUnclaimAllEvent)1