Package org.spout.vanilla.protocol.msg.entity

Examples of org.spout.vanilla.protocol.msg.entity.EntityStatusMessage


    event.getMessages().add(new EntityAnimationMessage(event.getEntity().getId(), (byte) event.getAnimation().getId()));
  }

  @EventHandler
  public void onEntityStatus(EntityStatusEvent event) {
    event.getMessages().add(new EntityStatusMessage(event.getEntity().getId(), event.getStatus()));
  }
View Full Code Here


        final int hunger = getHunger();

        //Timer when eating. Sends a Enting done if the player eated the food the whole time.
        if (eatingTimer != 0f) {
          if (eatingTimer >= 1.5f) {
            ((Player) getOwner()).getNetwork().getSession().send(new EntityStatusMessage(getOwner().getId(), EntityStatusMessage.EATING_ACCEPTED));
            if (foodEating.get() != null) {
              if (foodEating.get().getMaterial() instanceof Food) {
                ((Food) foodEating.get().getMaterial()).onEat(getOwner(), foodEating);
              } else if (foodEating.get().getMaterial() instanceof PotionItem) {
                ((PotionItem) foodEating.get().getMaterial()).onDrink(getOwner(), foodEating);
View Full Code Here

  @Override
  public EntityStatusMessage decode(ByteBuf buffer) throws IOException {
    int id = buffer.readInt();
    byte status = buffer.readByte();
    return new EntityStatusMessage(id, status);
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.entity.EntityStatusMessage

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.