Search in sources :

Example 1 with Faction

use of net.redstoneore.legacyfactions.entity.Faction in project Conquer by xXAndrew28Xx.

the class LFClaim method setTo.

@Override
public void setTo(ClaimType type) {
    Faction faction;
    switch(type) {
        case WILDERNESS:
            faction = FactionColl.get(LFPlugin.WILDERNESS_ID);
            break;
        case SAFE_ZONE:
            faction = FactionColl.get(LFPlugin.SAFE_ZONE_ID);
            break;
        case WAR_ZONE:
            faction = FactionColl.get(LFPlugin.WAR_ZONE_ID);
            break;
        default:
            return;
    }
    board.setFactionAt(faction, fLocation);
}
Also used : Faction(net.redstoneore.legacyfactions.entity.Faction)

Example 2 with Faction

use of net.redstoneore.legacyfactions.entity.Faction 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

Faction (net.redstoneore.legacyfactions.entity.Faction)2 Map (java.util.Map)1 ConquerFaction (me.andrew28.addons.conquer.api.ConquerFaction)1 ConquerPlayer (me.andrew28.addons.conquer.api.ConquerPlayer)1 ConquerLandClaimEvent (me.andrew28.addons.conquer.api.events.ConquerLandClaimEvent)1 FLocation (net.redstoneore.legacyfactions.FLocation)1 Chunk (org.bukkit.Chunk)1 EventHandler (org.bukkit.event.EventHandler)1