Java 类org.bukkit.util.EulerAngle 实例源码

项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = random.nextInt(5) + 9;
        this.jumps = random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = random.nextInt(5) + 9;
        this.jumps = random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final net.minecraft.server.v1_8_R3.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Kicks the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
        this.startVector.setY(verticalStrength);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
/**
 * Passes the ball with the given strength parameters
 *
 * @param entity             entity
 * @param horizontalStrength horizontalStrength
 * @param verticalStrength   verticalStrength
 */
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
    BallKickEvent event = null;
    if (entity instanceof Player) {
        event = new BallKickEvent((Player) entity, this);
        Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
    }
    if (event == null || !event.isCancelled()) {
        this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
        this.startVector.setY(verticalStrength * 0.5);
        try {
            this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
        } catch (final IllegalArgumentException ex) {

        }
        if (this.isRotating)
            this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
        this.rvalue = this.random.nextInt(5) + 9;
        this.jumps = this.random.nextInt(5) + 5;
    }
}
项目:BlockBall    文件:CustomArmorstand.java   
@Override
public void spawn(Location location) {
    NMSRegistry.accessWorldGuardSpawn(location);
    final net.minecraft.server.v1_8_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
    this.setPosition(location.getX(), location.getY(), location.getZ());
    mcWorld.addEntity(this, SpawnReason.CUSTOM);
    final NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("invulnerable", true);
    compound.setBoolean("Invisible", true);
    compound.setBoolean("PersistenceRequired", true);
    compound.setBoolean("NoBasePlate", true);
    this.a(compound);
    this.slime = new CustomRabbit(location.getWorld(), true, this);
    this.slime.spawn(location);
    this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
    this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
    this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
    NMSRegistry.rollbackWorldGuardSpawn(location);
}
项目:StickyTracker    文件:Tracker.java   
private void spawnTracker() {
    Player p = (Player) getTarget();
    ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    SkullMeta sm = (SkullMeta) skull.getItemMeta();
    sm.setOwner(playerWithTrackerHead);
    skull.setItemMeta(sm);

    World w = p.getWorld();
    armorStand = w.spawnEntity(p.getLocation(), EntityType.ARMOR_STAND);

    /*slime = w.spawnEntity(p.getLocation(), EntityType.SLIME);
    ((Slime) slime).setInvulnerable(true);
    ((Slime) slime).setAI(false);
    ((Slime) slime).setSize(2);
    slime.setPassenger(armorStand);*/
    p.setPassenger(armorStand);
    ((ArmorStand) armorStand).setHelmet(skull);
    ((ArmorStand) armorStand).setVisible(false);
    ((ArmorStand) armorStand).setSmall(true);
    ((ArmorStand) armorStand).setBodyPose(new EulerAngle(0.0, 3.57, 0.0));
}
项目:SharpSK    文件:ExprstandHead.java   
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
    if (mode == Changer.ChangeMode.SET) {
        try {
            if (en.getSingle(e) instanceof ArmorStand) {
                ArmorStand arstand = (ArmorStand) en.getSingle(e);
                double x = 0, y = 0, z = 0;
                Location loc2 = (Location) delta[0];

                x = Math.toRadians(loc2.getPitch());
                y = Math.toRadians(loc2.getYaw());
                EulerAngle a = new EulerAngle(x, y, z);
                arstand.setHeadPose(a);

            }
        } catch (NullPointerException ex) {

        }

    }
}
项目:EditArmorStands    文件:ArmorStandPoser.java   
public static EulerAngle getEulerAngleFromDegree(Axis axis, EulerAngle ea, int angle, boolean relative) {
    switch (axis) {
        case PITCH:
            double x = Math.toRadians(angle);
            if (relative)
                x += ea.getX();
            return ea.setX(x);
        case YAW:
            double y = Math.toRadians(angle);
            if (relative)
                y += ea.getY();
            return ea.setY(y);
        case ROLL:
            double z = Math.toRadians(angle);
            if (relative)
                z += ea.getZ();
            return ea.setZ(z);
    }
    return null;
}
项目:EditArmorStands    文件:ArmorStandPoser.java   
public boolean translatePlayerLook(BodyPart part, Location location) {
    Vector v = location.getDirection();
    EulerAngle ea = new EulerAngle(v.getX(), v.getY(), v.getZ());
    switch (part) {
        case HEAD:
            this.as.setHeadPose(ea);
            return true;
        case BODY:
            this.as.setBodyPose(ea);
            return true;
        case LEFTARM:
            this.as.setLeftArmPose(ea);
            return true;
        case LEFTLEG:
            this.as.setLeftLegPose(ea);
            return true;
        case RIGHTARM:
            this.as.setRightArmPose(ea);
            return true;
        case RIGHTLEG:
            this.as.setRightLegPose(ea);
            return true;
        default:
            return false;
    }
}
项目:MagicLib    文件:EntityArmorStandData.java   
@Override
public EntityExtraData clone() {
    EntityArmorStandData copy = new EntityArmorStandData();
    copy.itemInHand = itemInHand == null ? null : itemInHand.clone();
    copy.boots = boots == null ? null : boots.clone();
    copy.leggings = leggings == null ? null : leggings.clone();
    copy.chestplate = chestplate == null ? null : chestplate.clone();
    copy.helmet = helmet == null ? null : helmet.clone();
    copy.bodyPose = bodyPose == null ? null : new EulerAngle(bodyPose.getX(), bodyPose.getY(), bodyPose.getZ());
    copy.leftArmPose = leftArmPose == null ? null : new EulerAngle(leftArmPose.getX(), leftArmPose.getY(), leftArmPose.getZ());
    copy.rightArmPose = rightArmPose == null ? null : new EulerAngle(rightArmPose.getX(), rightArmPose.getY(), rightArmPose.getZ());
    copy.leftLegPose = leftLegPose == null ? null : new EulerAngle(leftLegPose.getX(), leftLegPose.getY(), leftLegPose.getZ());
    copy.rightLegPose = rightLegPose == null ? null : new EulerAngle(rightLegPose.getX(), rightLegPose.getY(), rightLegPose.getZ());
    copy.headPose = headPose == null ? null : new EulerAngle(headPose.getX(), headPose.getY(), headPose.getZ());
    copy.hasGravity = hasGravity;
    copy.isVisible = isVisible;
    copy.hasArms = hasArms;
    copy.isSmall = isSmall;
    return copy;
}
项目:Necessities    文件:Pot.java   
Pot(Location loc) {
    this.trueLoc = loc;
    int turn = 5;
    Location temp = loc.clone().add(0, 0.5, 0);
    for (int i = 0; i < 360 / turn; i++) {
        temp.setYaw(temp.getYaw() + turn);
        spawnYaw(1, temp);
    }
    for (int i = 0; i < 360 / turn; i++) {
        this.armorStands.get(i).setItemInHand(new ItemStack(Material.FISHING_ROD, 1));
        this.armorStands.get(i).setRightArmPose(new EulerAngle(Math.toRadians(135), Math.toRadians(90), 0));
        this.armorStands.get(i).setSmall(true);
    }
    spawn(1, loc.clone().add(0, 0.75, 0));
    this.armorStands.get(360 / turn).setItemInHand(new ItemStack(Material.STICK, 1));
    this.armorStands.get(360 / turn).setRightArmPose(new EulerAngle(Math.toRadians(90), Math.toRadians(90), Math.toRadians(90)));
    this.armorStands.get(360 / turn).setSmall(true);
}
项目:Necessities    文件:StrawHat.java   
StrawHat(Location loc) {
    this.trueLoc = loc;
    int turn = 5, turnV = 5;
    Location temp = loc.clone().add(0, 0.5, 0);
    for (int i = 0; i < 360 / turn; i++) {
        temp.setYaw(temp.getYaw() + turn);
        spawnYaw(1, temp);
    }
    for (int i = 0; i < 360 / turn; i++) {
        this.armorStands.get(i).setItemInHand(new ItemStack(Material.HAY_BLOCK, 1));
        this.armorStands.get(i).setRightArmPose(new EulerAngle(0, Math.toRadians(90), Math.toRadians(90)));
        this.armorStands.get(i).setSmall(true);
    }
    spawn(360 / turnV, loc.clone().add(0, 0.7, 0));
    for (int i = 0; i < 360 / turnV; i++) {
        this.armorStands.get(360 / turn + i).setHelmet(new ItemStack(Material.HAY_BLOCK, 1));
        this.armorStands.get(360 / turn + i).setSmall(true);
        this.armorStands.get(360 / turn + i).setHeadPose(new EulerAngle(Math.toRadians(45), Math.toRadians(i * turnV), 0));
    }
}
项目:Necessities    文件:Fedora.java   
Fedora(Location loc) {
    this.trueLoc = loc;
    int turn = 5, turnV = 5;
    Location temp = loc.clone().add(0, 0.5, 0);
    for (int i = 0; i < 360 / turn; i++) {
        temp.setYaw(temp.getYaw() + turn);
        spawnYaw(1, temp);
    }
    for (int i = 0; i < 360 / turn; i++) {
        this.armorStands.get(i).setItemInHand(new ItemStack(Material.COAL_BLOCK, 1));
        this.armorStands.get(i).setRightArmPose(new EulerAngle(Math.toRadians(135), Math.toRadians(90), 0));
        this.armorStands.get(i).setSmall(true);
    }
    spawn(360 / turnV, loc);
    for (int i = 0; i < 360 / turnV; i++) {
        this.armorStands.get(360 / turn + i).setHelmet(new ItemStack(Material.CARPET, 1, (short) 15));
        this.armorStands.get(360 / turn + i).setHeadPose(new EulerAngle(0, Math.toRadians(i * turnV), 0));
    }
    spawn(360 / turnV, loc.clone().add(0, 0.71, 0));
    for (int i = 0; i < 360 / turnV; i++) {
        this.armorStands.get(360 / turn + 360 / turnV + i).setHelmet(new ItemStack(Material.CARPET, 1, (short) 14));
        this.armorStands.get(360 / turn + 360 / turnV + i).setSmall(true);
        this.armorStands.get(360 / turn + 360 / turnV + i).setHeadPose(new EulerAngle(0, Math.toRadians(i * turnV), 0));
    }
}
项目:NucleusFramework    文件:BasicByteReader.java   
/**
 * Get the next group of bytes as an EulerAngle.
 *
 * <p>The angle is read as x, y and z value as doubles.
 * (See {@link #getDouble})</p>
 *
 * @throws IOException
 */
@Override
@Nullable
public EulerAngle getEulerAngle(EulerAngle output) throws IOException {
    PreCon.notNull(output);

    try {
        output.setX(getDouble());
    }
    catch (IOException e) {
        if (e.getMessage().equals("Failed to read double value."))
            return null;

        throw e;
    }
    output.setY(getDouble());
    output.setZ(getDouble());

    return output;
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final net.minecraft.server.v1_8_R1.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R1.CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final net.minecraft.server.v1_8_R1.NBTTagCompound compound = new net.minecraft.server.v1_8_R1.NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.rabbit.getEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final net.minecraft.server.v1_9_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final NBTTagCompound compound = new NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.getEngineEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}
项目:PetBlocks    文件:PetBlockHelper.java   
public static boolean setDieing(final PetBlock petBlock) {
    if (!petBlock.isDieing()) {
        petBlock.jump();
        if (petBlock.getArmorStand() != null && !getArmorstand(petBlock).isDead())
            getArmorstand(petBlock).setHeadPose(new EulerAngle(0, 1, 0));
        Bukkit.getPluginManager().getPlugin("PetBlocks").getServer().getScheduler().runTaskLater(Bukkit.getPluginManager().getPlugin("PetBlocks"), () -> {
            petBlock.getEffectPipeline().playParticleEffect(petBlock.getLocation(), cloud);
            petBlock.remove();
        }, 20 * 2);
        return true;
    }
    return petBlock.isDieing();
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final net.minecraft.server.v1_9_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final NBTTagCompound compound = new NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.getEngineEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final NBTTagCompound compound = new NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.getEngineEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final NBTTagCompound compound = new NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand) this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand) this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand) this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand) this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand) this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand) this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.getEngineEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}
项目:PetBlocks    文件:CustomGroundArmorstand.java   
public void spawn(Location location) {
    final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCanceled()) {
        NMSRegistry.accessWorldGuardSpawn(location);
        this.rabbit.spawn(location);
        final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
        this.setPosition(location.getX(), location.getY(), location.getZ());
        mcWorld.addEntity(this, SpawnReason.CUSTOM);
        final NBTTagCompound compound = new NBTTagCompound();
        compound.setBoolean("invulnerable", true);
        compound.setBoolean("Invisible", true);
        compound.setBoolean("PersistenceRequired", true);
        compound.setBoolean("ShowArms", true);
        compound.setBoolean("NoBasePlate", true);
        this.a(compound);
        ((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
        ((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
        ((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
        NMSRegistry.rollbackWorldGuardSpawn(location);
        ((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
        ((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
        ((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
        ((LivingEntity) this.getEngineEntity()).setRemoveWhenFarAway(false);
        this.health = ConfigPet.getInstance().getCombat_health();
        if (this.petMeta == null)
            return;
        PetBlockHelper.setItemConsideringAge(this);
    }
}