geforkt von Mirrors/Paper
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.
Dieser Commit ist enthalten in:
Ursprung
efe8e9a7f5
Commit
2e99e02094
@ -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;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren