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

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


  private HashMap<Player, Window> viewers = new HashMap<Player, Window>();

  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.VILLAGER));

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(20);
    }
View Full Code Here


*/
public class Creeper extends Living implements Hostile {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.CREEPER));
    getOwner().add(DeathDrops.class).addDrop(new ItemStack(VanillaMaterials.GUNPOWDER, getRandom().nextInt(2))).addXpDrop((short) 5);
    PhysicsComponent physics = getOwner().getPhysics();
    physics.activate(2f, new BoxShape(1f, 2f, 1f), false, true);
    physics.setFriction(10f);
    physics.setRestitution(0f);
View Full Code Here

*/
public class Cow extends Animal implements Passive {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.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 MagmaCube extends Living implements Hostile {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.MAGMA_CUBE));
    getOwner().add(DeathDrops.class).addDrop(new ItemStack(VanillaMaterials.MAGMA_CREAM, getRandom().nextInt(1)));
    if (getAttachedCount() == 1) {
      int spawnHealth = 1;
      if (getSize() == 2) {
        spawnHealth = 4;
View Full Code Here

*/
public class Pig extends Animal {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.PIG));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_PORKCHOP, getRandom().nextInt(2) + 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));

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

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

*/
public class Bat extends Living implements Passive {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.BAT));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(6);
    }

    // Add metadata for hanging state
View Full Code Here

*/
public class Spider extends Living implements Hostile, Aggressive {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SPIDER));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.STRING, random.nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.SPIDER_EYE, random.nextInt(1)));
    dropComponent.addXpDrop((short) 5);
View Full Code Here

*/
public class Slime extends Living implements Hostile {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SLIME));
    if (getAttachedCount() == 1) {
      int spawnHealth = 1;
      if (getSize() == 2) {
        spawnHealth = 4;
      } else if (getSize() == 4) {
View Full Code Here

*/
public class Silverfish extends Living implements Hostile {
  @Override
  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SILVERFISH));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(8);
    }
    getOwner().add(DeathDrops.class).addXpDrop((short) 5);
    Damage damage = getOwner().add(Damage.class);
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.