summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2013-02-06 16:32:19 -0600
committerfeildmaster <admin@feildmaster.com>2013-02-06 16:32:19 -0600
commit2e99e02094f51f581f7f98411e47a0f29cdeb3d6 (patch)
tree80d86c49022eafaebf279db0b9a3d448dc509b39 /src/main
parentefe8e9a7f504aed2d187e4aeb3bc55460ddf8eca (diff)
downloadcraftbukkit-2e99e02094f51f581f7f98411e47a0f29cdeb3d6.tar
craftbukkit-2e99e02094f51f581f7f98411e47a0f29cdeb3d6.tar.gz
craftbukkit-2e99e02094f51f581f7f98411e47a0f29cdeb3d6.tar.lz
craftbukkit-2e99e02094f51f581f7f98411e47a0f29cdeb3d6.tar.xz
craftbukkit-2e99e02094f51f581f7f98411e47a0f29cdeb3d6.zip
Use entity UUID instead of EntityID for metadata. Fixes BUKKIT-3582
The entity id is a non-unique, non-persistent value, and will cause entities to lose their respective meta data on chunk unloading, and teleportation.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/metadata/EntityMetadataStore.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/metadata/EntityMetadataStore.java b/src/main/java/org/bukkit/craftbukkit/metadata/EntityMetadataStore.java
index d592b9a5..35c484f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/metadata/EntityMetadataStore.java
+++ b/src/main/java/org/bukkit/craftbukkit/metadata/EntityMetadataStore.java
@@ -9,7 +9,8 @@ import org.bukkit.metadata.MetadataStoreBase;
*/
public class EntityMetadataStore extends MetadataStoreBase<Entity> implements MetadataStore<Entity> {
/**
- * Generates a unique metadata key for an {@link Entity} entity ID.
+ * Generates a unique metadata key for an {@link Entity} UUID.
+ *
* @see MetadataStoreBase#disambiguate(Object, String)
* @param entity the entity
* @param metadataKey The name identifying the metadata value
@@ -17,6 +18,6 @@ public class EntityMetadataStore extends MetadataStoreBase<Entity> implements Me
*/
@Override
protected String disambiguate(Entity entity, String metadataKey) {
- return Integer.toString(entity.getEntityId()) + ":" + metadataKey;
+ return entity.getUniqueId().toString() + ":" + metadataKey;
}
}