Search in sources :

Example 6 with ConquerLandClaimEvent

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

the class FOEventForwarder method onLandUnclaimEvent.

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

Example 7 with ConquerLandClaimEvent

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

the class FUEventForwarder method onLandUnclaimEvent.

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

Example 8 with ConquerLandClaimEvent

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

the class LFEventForwarder method onLandChange.

@EventHandler
public void onLandChange(EventFactionsLandChange event) {
    boolean claiming = event.getCause() == EventFactionsLandChange.LandChangeCause.Claim;
    ConquerPlayer player = LFPlayer.get(plugin, event.getFPlayer());
    Iterator<Map.Entry<FLocation, Faction>> iterator = event.getTransactions().entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<FLocation, Faction> entry = iterator.next();
        ConquerClaim<Chunk> claim = LFClaim.get(plugin, entry.getKey());
        ConquerFaction faction = LFFaction.get(plugin, entry.getValue());
        ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(claim, claiming, faction, player);
        callEvent(forwardEvent);
        if (forwardEvent.isCancelled()) {
            iterator.remove();
        }
    }
}
Also used : ConquerFaction(me.andrew28.addons.conquer.api.ConquerFaction) FLocation(net.redstoneore.legacyfactions.FLocation) ConquerLandClaimEvent(me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent) ConquerPlayer(me.andrew28.addons.conquer.api.ConquerPlayer) Chunk(org.bukkit.Chunk) Map(java.util.Map) ConquerFaction(me.andrew28.addons.conquer.api.ConquerFaction) Faction(net.redstoneore.legacyfactions.entity.Faction) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ConquerLandClaimEvent (me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent)8 EventHandler (org.bukkit.event.EventHandler)8 Map (java.util.Map)2 ConquerFaction (me.andrew28.addons.conquer.api.ConquerFaction)2 ConquerPlayer (me.andrew28.addons.conquer.api.ConquerPlayer)2 EventFactionsChunkChangeType (com.massivecraft.factions.event.EventFactionsChunkChangeType)1 EventFactionsChunksChange (com.massivecraft.factions.event.EventFactionsChunksChange)1 EventFactionsCreate (com.massivecraft.factions.event.EventFactionsCreate)1 EventFactionsDisband (com.massivecraft.factions.event.EventFactionsDisband)1 EventFactionsMembershipChange (com.massivecraft.factions.event.EventFactionsMembershipChange)1 EventFactionsPowerChange (com.massivecraft.factions.event.EventFactionsPowerChange)1 EventFactionsRelationChange (com.massivecraft.factions.event.EventFactionsRelationChange)1 PS (com.massivecraft.massivecore.ps.PS)1 Set (java.util.Set)1 ConquerClaim (me.andrew28.addons.conquer.api.ConquerClaim)1 EventForwarder (me.andrew28.addons.conquer.api.EventForwarder)1 Relation (me.andrew28.addons.conquer.api.Relation)1 ConquerFactionCreateEvent (me.andrew28.addons.conquer.api.events.ConquerFactionCreateEvent)1 ConquerFactionDisbandEvent (me.andrew28.addons.conquer.api.events.ConquerFactionDisbandEvent)1 ConquerFactionJoinEvent (me.andrew28.addons.conquer.api.events.ConquerFactionJoinEvent)1