Package org.spout.vanilla.protocol.msg.player

Examples of org.spout.vanilla.protocol.msg.player.PlayerHealthMessage


  }

  @EventHandler
  public void onPlayerUpdateStats(PlayerHealthEvent event) {
    Hunger hunger = getOwner().get(Hunger.class);
    event.getMessages().add(new PlayerHealthMessage(getOwner().get(Human.class).getHealth().getHealth(), (short) hunger.getHunger(), hunger.getFoodSaturation()));
  }
View Full Code Here


  @Override
  public PlayerHealthMessage decode(ByteBuf buffer) throws IOException {
    float health = buffer.readFloat();
    short food = buffer.readShort();
    float foodSaturation = buffer.readFloat();
    return new PlayerHealthMessage(health, food, foodSaturation);
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.player.PlayerHealthMessage

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.