Package com.bergerkiller.bukkit.common.wrappers

Examples of com.bergerkiller.bukkit.common.wrappers.DataWatcher


   * Obtains the DataWatcher to update and keep track of Entity metadata
   *
   * @return Entity meta data watcher
   */
  public DataWatcher getMetaData() {
    return new DataWatcher(getHandle(Entity.class).getDataWatcher());
  }
View Full Code Here


   * @param viewer to send the meta data to
   */
  @SuppressWarnings("unchecked")
  public void initMetaData(Player viewer) {
    // Meta Data
    DataWatcher metaData = entity.getMetaData();
    if (!metaData.isEmpty()) {
      PacketUtil.sendPacket(viewer, PacketType.OUT_ENTITY_METADATA.newInstance(entity.getEntityId(), metaData, true));
    }
    // Living Entity - only data
    if (handle instanceof EntityLiving) {
      // Entity Attributes
View Full Code Here

   * Movement and positioning information is not updated.
   * Only the changes are sent, it is a relative update.
   */
  public void syncMetaData() {
    // Meta Data
    DataWatcher meta = entity.getMetaData();
    if (meta.isChanged()) {
      broadcast(PacketType.OUT_ENTITY_METADATA.newInstance(entity.getEntityId(), meta, false), true);
    }
    // Living Entity - only data
    if (handle instanceof EntityLiving) {
      // Entity Attributes
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.common.wrappers.DataWatcher

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.