Search in sources :

Example 1 with CraftRaid

use of org.bukkit.craftbukkit.v1_16_R3.CraftRaid in project Magma-1.16.x by magmafoundation.

the class CraftEventFactory method callRaidTriggerEvent.

/**
 * Raid events
 */
public static boolean callRaidTriggerEvent(Raid raid, ServerPlayerEntity player) {
    RaidTriggerEvent event = new RaidTriggerEvent(new CraftRaid(raid), raid.getLevel().getWorldCB(), player.getBukkitEntity());
    Bukkit.getPluginManager().callEvent(event);
    return !event.isCancelled();
}
Also used : CraftRaid(org.bukkit.craftbukkit.v1_16_R3.CraftRaid) RaidTriggerEvent(org.bukkit.event.raid.RaidTriggerEvent)

Example 2 with CraftRaid

use of org.bukkit.craftbukkit.v1_16_R3.CraftRaid in project Magma-1.16.x by magmafoundation.

the class CraftEventFactory method callRaidStopEvent.

public static void callRaidStopEvent(Raid raid, RaidStopEvent.Reason reason) {
    RaidStopEvent event = new RaidStopEvent(new CraftRaid(raid), raid.getLevel().getWorldCB(), reason);
    Bukkit.getPluginManager().callEvent(event);
}
Also used : CraftRaid(org.bukkit.craftbukkit.v1_16_R3.CraftRaid) RaidStopEvent(org.bukkit.event.raid.RaidStopEvent)

Example 3 with CraftRaid

use of org.bukkit.craftbukkit.v1_16_R3.CraftRaid in project Magma-1.16.x by magmafoundation.

the class CraftEventFactory method callRaidFinishEvent.

public static void callRaidFinishEvent(Raid raid, List<Player> players) {
    RaidFinishEvent event = new RaidFinishEvent(new CraftRaid(raid), raid.getLevel().getWorldCB(), players);
    Bukkit.getPluginManager().callEvent(event);
}
Also used : CraftRaid(org.bukkit.craftbukkit.v1_16_R3.CraftRaid) RaidFinishEvent(org.bukkit.event.raid.RaidFinishEvent)

Example 4 with CraftRaid

use of org.bukkit.craftbukkit.v1_16_R3.CraftRaid in project Magma-1.16.x by magmafoundation.

the class CraftEventFactory method callRaidSpawnWaveEvent.

public static void callRaidSpawnWaveEvent(Raid raid, AbstractRaiderEntity leader, List<AbstractRaiderEntity> raiders) {
    Raider craftLeader = (CraftRaider) leader.getBukkitEntity();
    List<Raider> craftRaiders = new ArrayList<>();
    for (AbstractRaiderEntity entityRaider : raiders) {
        craftRaiders.add((Raider) entityRaider.getBukkitEntity());
    }
    RaidSpawnWaveEvent event = new RaidSpawnWaveEvent(new CraftRaid(raid), raid.getLevel().getWorldCB(), craftLeader, craftRaiders);
    Bukkit.getPluginManager().callEvent(event);
}
Also used : CraftRaider(org.bukkit.craftbukkit.v1_16_R3.entity.CraftRaider) Raider(org.bukkit.entity.Raider) ArrayList(java.util.ArrayList) RaidSpawnWaveEvent(org.bukkit.event.raid.RaidSpawnWaveEvent) CraftRaid(org.bukkit.craftbukkit.v1_16_R3.CraftRaid) CraftRaider(org.bukkit.craftbukkit.v1_16_R3.entity.CraftRaider) AbstractRaiderEntity(net.minecraft.entity.monster.AbstractRaiderEntity)

Example 5 with CraftRaid

use of org.bukkit.craftbukkit.v1_16_R3.CraftRaid in project LoliServer by Loli-Server.

the class CraftEventFactory method callRaidSpawnWaveEvent.

public static void callRaidSpawnWaveEvent(Raid raid, AbstractRaiderEntity leader, List<AbstractRaiderEntity> raiders) {
    Raider craftLeader = (CraftRaider) leader.getBukkitEntity();
    List<Raider> craftRaiders = new ArrayList<>();
    for (AbstractRaiderEntity entityRaider : raiders) {
        craftRaiders.add((Raider) entityRaider.getBukkitEntity());
    }
    RaidSpawnWaveEvent event = new RaidSpawnWaveEvent(new CraftRaid(raid), raid.getLevel().getWorld(), craftLeader, craftRaiders);
    Bukkit.getPluginManager().callEvent(event);
}
Also used : CraftRaider(org.bukkit.craftbukkit.v1_16_R3.entity.CraftRaider) ArrayList(java.util.ArrayList) RaidSpawnWaveEvent(org.bukkit.event.raid.RaidSpawnWaveEvent) CraftRaid(org.bukkit.craftbukkit.v1_16_R3.CraftRaid) CraftRaider(org.bukkit.craftbukkit.v1_16_R3.entity.CraftRaider) AbstractRaiderEntity(net.minecraft.entity.monster.AbstractRaiderEntity)

Aggregations

CraftRaid (org.bukkit.craftbukkit.v1_16_R3.CraftRaid)8 ArrayList (java.util.ArrayList)2 AbstractRaiderEntity (net.minecraft.entity.monster.AbstractRaiderEntity)2 CraftRaider (org.bukkit.craftbukkit.v1_16_R3.entity.CraftRaider)2 RaidFinishEvent (org.bukkit.event.raid.RaidFinishEvent)2 RaidSpawnWaveEvent (org.bukkit.event.raid.RaidSpawnWaveEvent)2 RaidStopEvent (org.bukkit.event.raid.RaidStopEvent)2 RaidTriggerEvent (org.bukkit.event.raid.RaidTriggerEvent)2 Raider (org.bukkit.entity.Raider)1