Package net.minecraft.server

Examples of net.minecraft.server.AttributeMapServer


   *
   * @param livingEntity to load
   * @param data to load from
   */
  public static void loadAttributes(LivingEntity livingEntity, CommonTagList data) {
    AttributeMapServer map = CommonNMS.getEntityAttributes(livingEntity);
    GenericAttributes.a(map, (NBTTagList) data.getHandle());
  }
View Full Code Here


   *
   * @param livingEntity to save
   * @return CommonTagList containing the saved data
   */
  public static CommonTagList saveAttributes(LivingEntity livingEntity) {
    AttributeMapServer map = CommonNMS.getEntityAttributes(livingEntity);
    return (CommonTagList) CommonTag.create(GenericAttributes.a(map));
  }
View Full Code Here

      PacketUtil.sendPacket(viewer, PacketType.OUT_ENTITY_METADATA.newInstance(entity.getEntityId(), metaData, true));
    }
    // Living Entity - only data
    if (handle instanceof EntityLiving) {
      // Entity Attributes
      AttributeMapServer attributeMap = (AttributeMapServer) EntityLivingRef.getAttributesMap.invoke(handle);
      Collection<?> attributes = attributeMap.c();
      if (!attributes.isEmpty()) {
        PacketUtil.sendPacket(viewer, PacketType.OUT_ENTITY_UPDATE_ATTRIBUTES.newInstance(entity.getEntityId(), attributes));
      }

      // Entity Equipment
View Full Code Here

      broadcast(PacketType.OUT_ENTITY_METADATA.newInstance(entity.getEntityId(), meta, false), true);
    }
    // Living Entity - only data
    if (handle instanceof EntityLiving) {
      // Entity Attributes
      AttributeMapServer attributeMap = (AttributeMapServer) EntityLivingRef.getAttributesMap.invoke(handle);
      Collection<?> attributes = attributeMap.c();
      if (!attributes.isEmpty()) {
        this.broadcast(PacketType.OUT_ENTITY_UPDATE_ATTRIBUTES.newInstance(entity.getEntityId(), attributes), true);
      }
      attributes.clear();
    }
View Full Code Here

TOP

Related Classes of net.minecraft.server.AttributeMapServer

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.