use of me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent in project Conquer by xXAndrew28Xx.
the class SFEventForwarder method onLeave.
@EventHandler
public void onLeave(FPlayerLeaveEvent event) {
ConquerFactionLeaveEvent forwardEvent = new ConquerFactionLeaveEvent(SFFaction.get(plugin, event.getFaction()), SFPlayer.get(plugin, event.getfPlayer()));
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
use of me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent 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);
}
}
use of me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent 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);
}
}
use of me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent in project Conquer by xXAndrew28Xx.
the class FOEventForwarder method onLeave.
@EventHandler
public void onLeave(FPlayerLeaveEvent event) {
ConquerFactionLeaveEvent forwardEvent = new ConquerFactionLeaveEvent(FOFaction.get(plugin, event.getFaction()), FOPlayer.get(plugin, event.getFPlayer()));
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
use of me.andrew28.addons.conquer.api.events.ConquerFactionLeaveEvent in project Conquer by xXAndrew28Xx.
the class FUEventForwarder method onLeave.
@EventHandler
public void onLeave(FPlayerLeaveEvent event) {
ConquerFactionLeaveEvent forwardEvent = new ConquerFactionLeaveEvent(FUFaction.get(plugin, event.getFaction()), FUPlayer.get(plugin, event.getfPlayer()));
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
Aggregations