mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 19:12:22 +01:00
Player metadata really should be keyed by UUID not name
This commit is contained in:
parent
ca6d2cf9dc
commit
57ab4cfc6f
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ import org.bukkit.metadata.MetadataStoreBase;
|
||||||
public class PlayerMetadataStore extends MetadataStoreBase<OfflinePlayer> implements MetadataStore<OfflinePlayer> {
|
public class PlayerMetadataStore extends MetadataStoreBase<OfflinePlayer> implements MetadataStore<OfflinePlayer> {
|
||||||
/**
|
/**
|
||||||
* Generates a unique metadata key for {@link org.bukkit.entity.Player} and {@link OfflinePlayer} using the player
|
* Generates a unique metadata key for {@link org.bukkit.entity.Player} and {@link OfflinePlayer} using the player
|
||||||
* name.
|
* UUID.
|
||||||
* @see MetadataStoreBase#disambiguate(Object, String)
|
* @see MetadataStoreBase#disambiguate(Object, String)
|
||||||
* @param player the player
|
* @param player the player
|
||||||
* @param metadataKey The name identifying the metadata value
|
* @param metadataKey The name identifying the metadata value
|
||||||
|
@ -18,6 +18,6 @@ public class PlayerMetadataStore extends MetadataStoreBase<OfflinePlayer> implem
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected String disambiguate(OfflinePlayer player, String metadataKey) {
|
protected String disambiguate(OfflinePlayer player, String metadataKey) {
|
||||||
return player.getName().toLowerCase(java.util.Locale.ENGLISH) + ":" + metadataKey;
|
return player.getUniqueId() + ":" + metadataKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue