Search in sources :

Example 1 with ConquerPowerLossEvent

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

the class FOEventForwarder method onPowerLossEvent.

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

Example 2 with ConquerPowerLossEvent

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

the class LFEventForwarder method onPowerLoss.

@EventHandler
public void onPowerLoss(EventFactionsPowerLoss event) {
    ConquerPlayer player = LFPlayer.get(plugin, event.getfPlayer());
    ConquerFaction faction = LFFaction.get(plugin, event.getFaction());
    ConquerPowerLossEvent forwardEvent = new ConquerPowerLossEvent(faction, player);
    callEvent(forwardEvent);
    if (forwardEvent.isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerPowerLossEvent(me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent) ConquerFaction(me.andrew28.addons.conquer.api.ConquerFaction) ConquerPlayer(me.andrew28.addons.conquer.api.ConquerPlayer) EventHandler(org.bukkit.event.EventHandler)

Example 3 with ConquerPowerLossEvent

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

the class MSEventForwarder method onPowerChange.

@EventHandler
public void onPowerChange(EventFactionsPowerChange event) {
    ConquerPlayer player = MSPlayer.get(plugin, event.getMPlayer());
    double oldPower = player.getPower();
    double newPower = event.getNewPower();
    if (newPower < oldPower) {
        ConquerPowerLossEvent forwardEvent = new ConquerPowerLossEvent(player.getFaction(), player);
        callEvent(forwardEvent);
        if (forwardEvent.isCancelled()) {
            event.setCancelled(true);
        }
    }
}
Also used : ConquerPowerLossEvent(me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent) ConquerPlayer(me.andrew28.addons.conquer.api.ConquerPlayer) EventHandler(org.bukkit.event.EventHandler)

Example 4 with ConquerPowerLossEvent

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

the class SFEventForwarder method onPowerLossEvent.

@EventHandler
public void onPowerLossEvent(PowerLossEvent event) {
    ConquerPowerLossEvent forwardEvent = new ConquerPowerLossEvent(SFFaction.get(plugin, event.getFaction()), SFPlayer.get(plugin, event.getfPlayer()));
    callEvent(forwardEvent);
    if (forwardEvent.isCancelled()) {
        event.setCancelled(true);
    }
}
Also used : ConquerPowerLossEvent(me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent) EventHandler(org.bukkit.event.EventHandler)

Example 5 with ConquerPowerLossEvent

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

the class FUEventForwarder method onPowerLossEvent.

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

Aggregations

ConquerPowerLossEvent (me.andrew28.addons.conquer.api.events.ConquerPowerLossEvent)5 EventHandler (org.bukkit.event.EventHandler)5 ConquerPlayer (me.andrew28.addons.conquer.api.ConquerPlayer)2 ConquerFaction (me.andrew28.addons.conquer.api.ConquerFaction)1