Package org.spout.vanilla.event.entity.network

Examples of org.spout.vanilla.event.entity.network.EntityStatusEvent


  }

  public void damage(float damage) {
    setDurability(getDurability() - damage);
    if (damage > 0.0f) {
      getOwner().getNetwork().callProtocolEvent(new EntityStatusEvent(getOwner(), EntityStatusMessage.ENTITY_HURT));
    }
  }
View Full Code Here


  /**
   * Is called when the sheep eats grass. Applies the bonuses to the sheep.
   */
  private void onGrassEaten() {
    getOwner().getNetwork().callProtocolEvent(new EntityStatusEvent(getOwner(), EntityStatusMessage.SHEEP_EAT_GRASS));
    getOwner().getData().put(VanillaData.SHEARED, false);
    long newGrowthTicks = getOwner().getData().get(VanillaData.GROWTH_TICKS) + GRASS_GROWTH_TICK_BONUS;
    if (newGrowthTicks > TICKS_UNTIL_ADULT) {
      newGrowthTicks = TICKS_UNTIL_ADULT;
    }
View Full Code Here

            onDeath();
          }
        } else if (isDead()) {
          if (hasDeathAnimation()) {
            setDeathTicks(DEATH_TIME_TICKS);
            getOwner().getNetwork().callProtocolEvent(new EntityStatusEvent(getOwner(), EntityStatusMessage.ENTITY_DEAD));
          } else {
            onDeath();
          }
        }
        break;
View Full Code Here

      hunger.setExhaustion(hunger.getExhaustion() + 0.3f);
    }

    if (event.getSendMessage()) {
      getOwner().getNetwork().callProtocolEvent(new EntityAnimationEvent(getOwner(), Animation.DAMAGE_ANIMATION));
      getOwner().getNetwork().callProtocolEvent(new EntityStatusEvent(getOwner(), EntityStatusMessage.ENTITY_HURT));
      //getHurtEffect().playGlobal(getParent().getParent().getPosition());
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.event.entity.network.EntityStatusEvent

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.