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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations