Examples of EntityMetadataMessage


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

        int yaw = Position.getIntYaw(location);
        int pitch = Position.getIntPitch(location);

        return Arrays.asList(
                new SpawnObjectMessage(id, 2, x, y, z, pitch, yaw),
                new EntityMetadataMessage(id, metadata.getEntryList()),
                // these keep the client from assigning a random velocity
                new EntityTeleportMessage(id, x, y, z, yaw, pitch),
                new EntityVelocityMessage(id, getVelocity())
        );
    }
View Full Code Here

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

        }

        // send changed metadata
        List<MetadataMap.Entry> changes = metadata.getChanges();
        if (changes.size() > 0) {
            session.send(new EntityMetadataMessage(SELF_ID, changes));
        }

        // update or remove entities
        List<Integer> destroyIds = new LinkedList<>();
        for (Iterator<GlowEntity> it = knownEntities.iterator(); it.hasNext(); ) {
View Full Code Here

Examples of net.lightstone.msg.EntityMetadataMessage

  @Override
  public EntityMetadataMessage decode(ChannelBuffer buffer) throws IOException {
    int id = buffer.readInt();
    Parameter<?>[] parameters = ChannelBufferUtils.readParameters(buffer);
    return new EntityMetadataMessage(id, parameters);
  }
View Full Code Here

Examples of net.lightstone.msg.EntityMetadataMessage

  public void setCrouching(boolean crouching) {
    // TODO: update other clients, needs to be figured out
    this.crouching = crouching;
    setMetadata(new Parameter<Byte>(Parameter.TYPE_BYTE, 0, new Byte((byte) (crouching ? 0x02: 0))));
    // FIXME: other bits in the bitmask would be wiped out
    EntityMetadataMessage message = new EntityMetadataMessage(id, metadata.clone());
    for (Player player : world.getPlayers()) { // TODO: this only needs to be sent to local players I think
      if (player != this) {
        player.getSession().send(message);
      }
    }
View Full Code Here

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

    event.getMessages().add(new PlayerHealthMessage(getOwner().get(Human.class).getHealth().getHealth(), (short) hunger.getHunger(), hunger.getFoodSaturation()));
  }

  @EventHandler
  public void onEntityMetaChange(EntityMetaChangeEvent event) {
    event.getMessages().add(new EntityMetadataMessage(event.getEntity().getId(), event.getParameters()));
  }
View Full Code Here

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

    }*/

    // Refresh metadata
    List<Parameter<?>> params = getUpdateParameters(entity);
    if (!params.isEmpty()) {
      messages.add(new EntityMetadataMessage(entity.getId(), params));
    }
    return messages;
  }
View Full Code Here

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

  @Override
  public EntityMetadataMessage decode(ByteBuf buffer) throws IOException {
    int id = buffer.readInt();
    List<Parameter<?>> parameters = VanillaByteBufUtils.readParameters(buffer);
    return new EntityMetadataMessage(id, parameters);
  }
View Full Code Here

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

  @Override
  public List<Message> getSpawnMessages(Entity entity, RepositionManager rm) {
    List<Message> msgs = new ArrayList<Message>();
    msgs.add(new EntityObjectMessage(entity, (byte) typeId, VanillaByteBufUtils.getNativeDirection(entity.add(ItemFrame.class).getOrientation()), rm));
    msgs.add(new EntityMetadataMessage(entity.getId(), this.getSpawnParameters(entity)));
    return msgs;
  }
View Full Code Here

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

  @Override
  public List<Message> getSpawnMessages(Entity entity, RepositionManager rm) {
    List<Message> messages = new ArrayList<>();
    messages.add(new EntityObjectMessage(entity, (byte) typeId, rm));
    messages.add(new EntityMetadataMessage(entity.getId(), getSpawnParameters(entity)));
    return messages;
  }
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.