All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.metadata.EntityMetadataStore Maven / Gradle / Ivy

The newest version!
package org.bukkit.craftbukkit.metadata;

import org.bukkit.entity.Entity;
import org.bukkit.metadata.MetadataStore;
import org.bukkit.metadata.MetadataStoreBase;

/**
 * An EntityMetadataStore stores metadata values for all {@link Entity} classes an their descendants.
 */
public class EntityMetadataStore extends MetadataStoreBase implements MetadataStore {
  /**
   * Generates a unique metadata key for an {@link Entity} UUID.
   *
   * @param entity      the entity
   * @param metadataKey The name identifying the metadata value
   * @return a unique metadata key
   * @see MetadataStoreBase#disambiguate(Object, String)
   */
  @Override
  protected String disambiguate(Entity entity, String metadataKey) {
    return entity.getUniqueId().toString() + ":" + metadataKey;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy