Search in sources :

Example 1 with AbstractRaiderEntity

use of net.minecraft.entity.monster.AbstractRaiderEntity 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 2 with AbstractRaiderEntity

use of net.minecraft.entity.monster.AbstractRaiderEntity 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

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