use of me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent in project Conquer by xXAndrew28Xx.
the class SFEventForwarder method onLandUnclaimEvent.
@EventHandler
public void onLandUnclaimEvent(LandUnclaimEvent event) {
ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(SFClaim.get(plugin, event.getLocation()), false, 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.ConquerLandClaimEvent in project Conquer by xXAndrew28Xx.
the class SFEventForwarder method onLandClaim.
@EventHandler
public void onLandClaim(LandClaimEvent event) {
ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(SFClaim.get(plugin, event.getLocation()), true, 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.ConquerLandClaimEvent in project Conquer by xXAndrew28Xx.
the class FUEventForwarder method onLandClaim.
@EventHandler
public void onLandClaim(LandClaimEvent event) {
ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(FUClaim.get(plugin, event.getLocation()), true, FUFaction.get(plugin, event.getFaction()), FUPlayer.get(plugin, event.getfPlayer()));
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
use of me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent in project Conquer by xXAndrew28Xx.
the class MSEventForwarder method onClaimChange.
@EventHandler
public void onClaimChange(EventFactionsChunksChange event) {
ConquerFaction faction = MSFaction.get(plugin, event.getNewFaction());
ConquerPlayer player = MSPlayer.get(plugin, event.getMPlayer());
Set<PS> chunks = event.getChunks();
Map<PS, EventFactionsChunkChangeType> chunkTypeMap = event.getChunkType();
// Check if it's an unclaim all
if (chunks.size() == faction.getClaims().length && chunkTypeMap.values().stream().allMatch(type -> type == EventFactionsChunkChangeType.SELL)) {
ConquerUnclaimAllEvent forwardEvent = new ConquerUnclaimAllEvent(faction, player);
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
for (PS chunk : chunks) {
EventFactionsChunkChangeType type = chunkTypeMap.get(chunk);
ConquerClaim claim = MSClaim.get(plugin, chunk);
Event forwardEvent;
switch(type) {
case NONE:
continue;
case BUY:
forwardEvent = new ConquerLandClaimEvent(claim, true, faction, player);
break;
case CONQUER:
case PILLAGE:
forwardEvent = new ConquerLandClaimEvent(claim, false, faction, player);
break;
default:
return;
}
callEvent(forwardEvent);
if (((Cancellable) forwardEvent).isCancelled()) {
event.setCancelled(true);
return;
}
}
}
use of me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent in project Conquer by xXAndrew28Xx.
the class FOEventForwarder method onLandClaim.
@EventHandler
public void onLandClaim(LandClaimEvent event) {
ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(FOClaim.get(plugin, event.getLocation()), true, FOFaction.get(plugin, event.getFaction()), FOPlayer.get(plugin, event.getFPlayer()));
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
event.setCancelled(true);
}
}
Aggregations