Package org.spout.vanilla.protocol.entity.creature

Examples of org.spout.vanilla.protocol.entity.creature.CreatureProtocol


  @Override
  public void onAttached() {
    super.onAttached();
    Float nextEgg = (float) (GenericMath.getRandom().nextInt(MINIMUM_EGG_BREEDING_TIME) + MINIMUM_EGG_BREEDING_TIME);
    getOwner().getData().put(VanillaData.TIME_TILL_EGG, nextEgg);
    setEntityProtocol(new CreatureProtocol(CreatureType.CHICKEN));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.FEATHER, getRandom().nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_CHICKEN, 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));
View Full Code Here


*/
public class MooshroomCow extends Living implements Passive {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.MUSHROOM_COW));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_BEEF, random.nextInt(2) + 1));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.LEATHER, random.nextInt(2)));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));
View Full Code Here

*/
public class IronGolem extends Living implements Utility {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.IRON_GOLEM)); //Index 16 (byte): Unknown, example: 1
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.IRON_INGOT, random.nextInt(2) + 3));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.ROSE, random.nextInt(2)));
    if (getAttachedCount() == 1) {
View Full Code Here

*/
public class Enderman extends Living implements Neutral {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.ENDERMAN));

    //Physics
    PhysicsComponent physics = getOwner().getPhysics();
    physics.activate(2f, new BoxShape(1f, 2f, 1f), false, true);
    physics.setFriction(10f);
View Full Code Here

*/
public class SnowGolem extends Living implements Utility {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SNOW_GOLEM));
    getOwner().add(DeathDrops.class).addDrop(new ItemStack(VanillaMaterials.SNOWBALL, getRandom().nextInt(15)));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(100);
    }
  }
View Full Code Here

*/
public class Wolf extends Animal implements Neutral, Aggressive, Tameable {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.WOLF));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(8);
    }

    Damage damage = getOwner().add(Damage.class);
View Full Code Here

*/
public class PigZombie extends Living implements Neutral {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.PIG_ZOMBIE));
    getOwner().add(EntityInventory.class);
    getOwner().add(EntityItemCollector.class);
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(20);
    }
View Full Code Here

  private static final int GRASS_CHANCE_AS_BABY = 50;

  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SHEEP));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.WOOL, 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));

    if (getAttachedCount() == 1) {
View Full Code Here

  public static final int OWNER_INDEX = 21; // MC Data index for owner's name
  public static final int ARMOR_TYPE_INDEX = 22; // MC Data index for amount of armor type the horse currently wears, None 0, Iron 1, Gold 2, Diamond 3

  @Override
  public void onAttached() {
    setEntityProtocol(new CreatureProtocol(CreatureType.HORSE));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(DEFAULT_HEALTH);
    }
    super.onAttached();
View Full Code Here

*/
public class Ocelot extends Animal implements Passive, Tameable {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.OCELOT));

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
    getOwner().add(DeathDrops.class).addXpDrop((short) (getRandom().nextInt(3) + 1));
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.entity.creature.CreatureProtocol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.