Search in sources :

Example 66 with CraftWorld

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

the class ArenaInitializer1_9_R1 method spawnHalfInvisibleZombie.

@Override
public void spawnHalfInvisibleZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size() - 1));
    net.minecraft.server.v1_9_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_9_R1.FastZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_9_R1.TankerZombie) Zombie(org.bukkit.entity.Zombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_9_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_9_R1.BabyZombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_9_R1.HardZombie) PotionEffect(org.bukkit.potion.PotionEffect) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_9_R1.CraftWorld) Location(org.bukkit.Location)

Example 67 with CraftWorld

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

the class ArenaInitializer1_11_R1 method spawnKnockbackResistantZombies.

@Override
public void spawnKnockbackResistantZombies(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_11_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    TankerZombie fastZombie = new TankerZombie(location.getWorld());
    fastZombie.getAttributeInstance(GenericAttributes.c).setValue(Double.MAX_VALUE);
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    zombie.getEquipment().setItemInHand(new ItemStack(Material.GOLD_AXE));
    zombie.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
    zombie.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
    zombie.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    zombie.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
    zombie.setRemoveWhenFarAway(false);
    CreatureUtils.applyHealthBar(zombie);
    this.addZombie((Zombie) fastZombie.getBukkitEntity());
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    super.subtractZombiesToSpawn();
}
Also used : Zombie(org.bukkit.entity.Zombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.TankerZombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.HardZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.BabyZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.FastZombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.TankerZombie) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld) Location(org.bukkit.Location)

Example 68 with CraftWorld

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

the class ArenaInitializer1_11_R1 method spawnBabyZombie.

public void spawnBabyZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_11_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) TankerZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.TankerZombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.HardZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.BabyZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.FastZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.BabyZombie) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld) Location(org.bukkit.Location)

Example 69 with CraftWorld

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

the class ArenaInitializer1_11_R1 method spawnHalfInvisibleZombie.

@Override
public void spawnHalfInvisibleZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_11_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_11_R1.FastZombie) Zombie(org.bukkit.entity.Zombie) TankerZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.TankerZombie) HardZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.HardZombie) BabyZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.BabyZombie) FastZombie(pl.plajer.villagedefense3.creatures.v1_11_R1.FastZombie) PotionEffect(org.bukkit.potion.PotionEffect) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld) Location(org.bukkit.Location)

Example 70 with CraftWorld

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

the class ArenaInitializer1_11_R1 method spawnVillager.

public void spawnVillager(Location location) {
    net.minecraft.server.v1_11_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_11_R1.RidableVillager) Villager(org.bukkit.entity.Villager) RidableVillager(pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld)

Aggregations

Location (org.bukkit.Location)55 Zombie (org.bukkit.entity.Zombie)32 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)28 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)28 ItemStack (org.bukkit.inventory.ItemStack)27 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)23 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)19 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)17 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)17 ServerLevel (net.minecraft.server.level.ServerLevel)16 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)16 GameProfile (com.mojang.authlib.GameProfile)11 UUID (java.util.UUID)11 Scoreboard (org.bukkit.scoreboard.Scoreboard)11 Team (org.bukkit.scoreboard.Team)11 CraftWorld (org.bukkit.craftbukkit.v1_9_R2.CraftWorld)8 BabyZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.BabyZombie)8 FastZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.FastZombie)8 HardZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.HardZombie)8 TankerZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.TankerZombie)8