Commits
md_5 authored 7004fcf2e83
1 1 | package org.bukkit.attribute; |
2 2 | |
3 3 | import com.google.common.base.Preconditions; |
4 + | import java.nio.charset.StandardCharsets; |
4 5 | import java.util.HashMap; |
5 6 | import java.util.Locale; |
6 7 | import java.util.Map; |
7 8 | import java.util.Objects; |
8 9 | import java.util.UUID; |
9 10 | import org.bukkit.Keyed; |
10 11 | import org.bukkit.NamespacedKey; |
11 12 | import org.bukkit.configuration.serialization.ConfigurationSerializable; |
12 13 | import org.bukkit.inventory.EquipmentSlot; |
13 14 | import org.bukkit.inventory.EquipmentSlotGroup; |
58 59 | /** |
59 60 | * Get the unique ID for this modifier. |
60 61 | * |
61 62 | * @return unique id |
62 63 | * @see #getKey() |
63 64 | * @deprecated attributes are now identified by keys |
64 65 | */ |
65 66 | |
66 67 | |
67 68 | public UUID getUniqueId() { |
68 - | return UUID.fromString(getKey().toString()); |
69 + | return UUID.nameUUIDFromBytes(getKey().toString().getBytes(StandardCharsets.UTF_8)); |
69 70 | } |
70 71 | |
71 72 | |
72 73 | |
73 74 | public NamespacedKey getKey() { |
74 75 | return key; |
75 76 | } |
76 77 | |
77 78 | /** |
78 79 | * Get the name of this modifier. |