Search in sources :

Example 1 with RidableVillager

use of pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager 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 2 with RidableVillager

use of pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager 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)

Example 3 with RidableVillager

use of pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager in project Village_Defense by Plajer.

the class ArenaInitializer1_8_R3 method spawnVillager.

public void spawnVillager(Location location) {
    net.minecraft.server.v1_8_R3.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(villager, this);
}
Also used : RidableVillager(pl.plajer.villagedefense3.creatures.v1_8_R3.RidableVillager) Villager(org.bukkit.entity.Villager) RidableVillager(pl.plajer.villagedefense3.creatures.v1_8_R3.RidableVillager) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

Example 4 with RidableVillager

use of pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager in project Village_Defense by Plajer.

the class ArenaInitializer1_9_R1 method spawnVillager.

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

Aggregations

Villager (org.bukkit.entity.Villager)4 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)1 RidableVillager (pl.plajer.villagedefense3.creatures.v1_11_R1.RidableVillager)1 RidableVillager (pl.plajer.villagedefense3.creatures.v1_12_R1.RidableVillager)1 RidableVillager (pl.plajer.villagedefense3.creatures.v1_8_R3.RidableVillager)1 RidableVillager (pl.plajer.villagedefense3.creatures.v1_9_R1.RidableVillager)1