Examples of AnimateEntityMessage


Examples of net.glowstone.net.message.play.entity.AnimateEntityMessage

public final class AnimateEntityCodec implements Codec<AnimateEntityMessage> {
    @Override
    public AnimateEntityMessage decode(ByteBuf buf) throws IOException {
        int id = ByteBufUtils.readVarInt(buf);
        int animation = buf.readUnsignedByte();
        return new AnimateEntityMessage(id, animation);
    }
View Full Code Here

Examples of net.glowstone.net.message.play.entity.AnimateEntityMessage

            // todo: item interactions with air
        }

        if (!EventFactory.callEvent(new PlayerAnimationEvent(player)).isCancelled()) {
            // play the animation to others
            AnimateEntityMessage toSend = new AnimateEntityMessage(player.getEntityId(), AnimateEntityMessage.OUT_SWING_ARM);
            for (GlowPlayer observer : player.getWorld().getRawPlayers()) {
                if (observer != player && observer.canSeeEntity(player)) {
                    observer.getSession().send(toSend);
                }
            }
View Full Code Here

Examples of net.lightstone.msg.AnimateEntityMessage

  @Override
  public AnimateEntityMessage decode(ChannelBuffer buffer) throws IOException {
    int id = buffer.readInt();
    int animation = buffer.readUnsignedByte();
    return new AnimateEntityMessage(id, animation);
  }
View Full Code Here

Examples of net.lightstone.msg.AnimateEntityMessage

public final class AnimateEntityMessageHandler extends MessageHandler<AnimateEntityMessage> {

  @Override
  public void handle(Session session, Player player, AnimateEntityMessage message) {
    // TODO check the animation id is valid?
    message = new AnimateEntityMessage(player.getId(), message.getAnimation());
    for (Player p : player.getWorld().getPlayers()) {
      if (p != player) {
        p.getSession().send(message);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.