Search in sources :

Example 51 with CraftWorld

use of org.bukkit.craftbukkit.v1_15_R1.CraftWorld in project Village_Defense by Plajer.

the class ArenaInitializer1_12_R1 method spawnHalfInvisibleZombie.

@Override
public void spawnHalfInvisibleZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    FastZombie fastZombie = new FastZombie(location.getWorld());
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    zombie.setRemoveWhenFarAway(false);
    zombie.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
    zombie.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1));
    CreatureUtils.applyHealthBar(zombie);
    this.addZombie((Zombie) fastZombie.getBukkitEntity());
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    super.subtractZombiesToSpawn();
}
Also used : FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) Zombie(org.bukkit.entity.Zombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.HardZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.BabyZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.TankerZombie) PotionEffect(org.bukkit.potion.PotionEffect) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location)

Example 52 with CraftWorld

use of org.bukkit.craftbukkit.v1_15_R1.CraftWorld in project Village_Defense by Plajer.

the class ArenaInitializer1_12_R1 method spawnGolemBuster.

public void spawnGolemBuster(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    GolemBuster fastZombie = new GolemBuster(location.getWorld());
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    zombie.getEquipment().setHelmet(new ItemStack(Material.TNT));
    zombie.getEquipment().setHelmetDropChance(0.0F);
    zombie.getEquipment().setItemInHandDropChance(0F);
    zombie.setRemoveWhenFarAway(false);
    CreatureUtils.applyHealthBar(zombie);
    this.addZombie(zombie);
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    super.subtractZombiesToSpawn();
}
Also used : GolemBuster(pl.plajer.villagedefense3.creatures.v1_12_R1.GolemBuster) Zombie(org.bukkit.entity.Zombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.HardZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.BabyZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.TankerZombie) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location)

Example 53 with CraftWorld

use of org.bukkit.craftbukkit.v1_15_R1.CraftWorld in project Village_Defense by Plajer.

the class ArenaInitializer1_12_R1 method spawnVillager.

public void spawnVillager(Location location) {
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    RidableVillager ridableVillager = new RidableVillager(location.getWorld());
    ridableVillager.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(ridableVillager, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Villager villager = (Villager) ridableVillager.getBukkitEntity();
    villager.setRemoveWhenFarAway(false);
    this.addVillager((Villager) ridableVillager.getBukkitEntity());
    CreatureUtils.applyMetadata(ridableVillager.getBukkitEntity(), this);
}
Also used : RidableVillager(pl.plajer.villagedefense3.creatures.v1_12_R1.RidableVillager) Villager(org.bukkit.entity.Villager) RidableVillager(pl.plajer.villagedefense3.creatures.v1_12_R1.RidableVillager) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 54 with CraftWorld

use of org.bukkit.craftbukkit.v1_15_R1.CraftWorld in project Village_Defense by Plajer.

the class ArenaInitializer1_12_R1 method spawnFastZombie.

public void spawnFastZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    FastZombie fastZombie = new FastZombie(location.getWorld());
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    zombie.setRemoveWhenFarAway(false);
    CreatureUtils.applyHealthBar(zombie);
    this.addZombie((Zombie) fastZombie.getBukkitEntity());
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    super.subtractZombiesToSpawn();
}
Also used : FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) Zombie(org.bukkit.entity.Zombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.HardZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.BabyZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.TankerZombie) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location)

Example 55 with CraftWorld

use of org.bukkit.craftbukkit.v1_15_R1.CraftWorld in project Village_Defense by Plajer.

the class ArenaInitializer1_12_R1 method spawnBabyZombie.

public void spawnBabyZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    BabyZombie fastZombie = new BabyZombie(location.getWorld());
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    CreatureUtils.applyHealthBar(zombie);
    zombie.setRemoveWhenFarAway(false);
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    this.addZombie((Zombie) fastZombie.getBukkitEntity());
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    super.subtractZombiesToSpawn();
}
Also used : Zombie(org.bukkit.entity.Zombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.HardZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.BabyZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.TankerZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.BabyZombie) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location)

Aggregations

ServerLevel (net.minecraft.server.level.ServerLevel)63 Location (org.bukkit.Location)56 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)42 ItemStack (org.bukkit.inventory.ItemStack)42 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)40 BlockPos (net.minecraft.core.BlockPos)36 Zombie (org.bukkit.entity.Zombie)32 LivingEntity (org.bukkit.entity.LivingEntity)29 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)28 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)28 ItemEntity (net.minecraft.world.entity.item.ItemEntity)27 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)26 HangingEntity (net.minecraft.world.entity.decoration.HangingEntity)25 FallingBlockEntity (net.minecraft.world.entity.item.FallingBlockEntity)25 FireworkRocketEntity (net.minecraft.world.entity.projectile.FireworkRocketEntity)25 SignBlockEntity (net.minecraft.world.level.block.entity.SignBlockEntity)25 Entity (org.bukkit.entity.Entity)25 HumanEntity (org.bukkit.entity.HumanEntity)25 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)23 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)17