Search in sources :

Example 56 with CraftWorld

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

the class ArenaInitializer1_12_R1 method spawnKnockbackResistantZombies.

@Override
public void spawnKnockbackResistantZombies(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_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);
    CreatureUtils.applyMetadata(fastZombie.getBukkitEntity(), this);
    this.addZombie((Zombie) fastZombie.getBukkitEntity());
    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) 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 57 with CraftWorld

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

the class ArenaInitializer1_12_R1 method spawnWolf.

public void spawnWolf(Location location, Player player) {
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    WorkingWolf wolf = new WorkingWolf(location.getWorld());
    wolf.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(wolf, CreatureSpawnEvent.SpawnReason.CUSTOM);
    wolf.setCustomName(ChatManager.colorMessage("In-Game.Spawned-Wolf-Name").replaceAll("%player%", player.getName()));
    wolf.setCustomNameVisible(true);
    wolf.setInvisible(false);
    ((Wolf) wolf.getBukkitEntity()).setOwner(player);
    CreatureUtils.applyMetadata(wolf.getBukkitEntity(), this);
    this.addWolf((Wolf) wolf.getBukkitEntity());
}
Also used : WorkingWolf(pl.plajer.villagedefense3.creatures.v1_12_R1.WorkingWolf) WorkingWolf(pl.plajer.villagedefense3.creatures.v1_12_R1.WorkingWolf) Wolf(org.bukkit.entity.Wolf) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 58 with CraftWorld

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

the class ArenaInitializer1_12_R1 method spawnHardZombie.

public void spawnHardZombie(Random random) {
    Location location = zombieSpawns.get(random.nextInt(zombieSpawns.size()));
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    HardZombie fastZombie = new HardZombie(location.getWorld());
    fastZombie.setPosition(location.getX(), location.getY(), location.getZ());
    McWorld.addEntity(fastZombie, CreatureSpawnEvent.SpawnReason.CUSTOM);
    Zombie zombie = (Zombie) fastZombie.getBukkitEntity();
    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);
    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) ItemStack(org.bukkit.inventory.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location) HardZombie(pl.plajer.villagedefense3.creatures.v1_12_R1.HardZombie)

Example 59 with CraftWorld

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

the class ArenaInitializer1_12_R1 method spawnGolem.

public void spawnGolem(Location location, Player player) {
    net.minecraft.server.v1_12_R1.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    RidableIronGolem ironGolem = new RidableIronGolem(location.getWorld());
    ironGolem.setPosition(location.getX(), location.getY(), location.getZ());
    ironGolem.setCustomName(ChatManager.colorMessage("In-Game.Spawned-Golem-Name").replaceAll("%player%", player.getName()));
    ironGolem.setCustomNameVisible(true);
    McWorld.addEntity(ironGolem, CreatureSpawnEvent.SpawnReason.CUSTOM);
    CreatureUtils.applyMetadata(ironGolem.getBukkitEntity(), this);
    this.addIronGolem((org.bukkit.entity.IronGolem) ironGolem.getBukkitEntity());
}
Also used : RidableIronGolem(pl.plajer.villagedefense3.creatures.v1_12_R1.RidableIronGolem) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 60 with CraftWorld

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

the class ArenaInitializer1_8_R3 method spawnGolem.

public void spawnGolem(Location location, Player player) {
    net.minecraft.server.v1_8_R3.World McWorld = ((CraftWorld) location.getWorld()).getHandle();
    RidableIronGolem ironGolem = new RidableIronGolem(location.getWorld());
    ironGolem.setPosition(location.getX(), location.getY(), location.getZ());
    ironGolem.setCustomName(ChatManager.colorMessage("In-Game.Spawned-Golem-Name").replaceAll("%player%", player.getName()));
    ironGolem.setCustomNameVisible(true);
    McWorld.addEntity(ironGolem, CreatureSpawnEvent.SpawnReason.CUSTOM);
    this.addIronGolem((org.bukkit.entity.IronGolem) ironGolem.getBukkitEntity());
    CreatureUtils.applyMetadata(ironGolem.getBukkitEntity(), this);
}
Also used : RidableIronGolem(pl.plajer.villagedefense3.creatures.v1_8_R3.RidableIronGolem) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

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