|
5 | 5 | import java.lang.reflect.InvocationTargetException; |
6 | 6 | import java.lang.reflect.Method; |
7 | 7 | import java.util.ArrayList; |
| 8 | +import java.util.HashMap; |
8 | 9 | import java.util.List; |
9 | 10 | import java.util.UUID; |
10 | 11 | import java.util.function.BiConsumer; |
|
14 | 15 | import org.bukkit.inventory.ItemStack; |
15 | 16 | import org.bukkit.inventory.meta.SkullMeta; |
16 | 17 |
|
| 18 | +import com.google.common.collect.Multimaps; |
17 | 19 | import com.google.gson.JsonArray; |
18 | 20 | import com.google.gson.JsonElement; |
19 | 21 | import com.google.gson.JsonObject; |
20 | 22 | import com.mojang.authlib.GameProfile; |
21 | 23 | import com.mojang.authlib.properties.Property; |
| 24 | +import com.mojang.authlib.properties.PropertyMap; |
22 | 25 | import com.mojang.serialization.DataResult; |
23 | 26 | import com.mojang.serialization.Dynamic; |
24 | 27 | import com.mojang.serialization.DynamicOps; |
@@ -192,8 +195,11 @@ public JsonObject migrateToJsonElement(byte[] binary) { |
192 | 195 | @Override |
193 | 196 | public void setSkullProfile(SkullMeta meta, String texture) { |
194 | 197 | try { |
195 | | - GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ""); |
196 | | - gameProfile.properties().put("textures", new Property("textures", texture)); |
| 198 | + HashMap<String, Property> properties = new HashMap<>(); |
| 199 | + properties.put("textures", new Property("textures", texture)); |
| 200 | + |
| 201 | + PropertyMap propertyMap = new PropertyMap(Multimaps.forMap(properties)); |
| 202 | + GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "", propertyMap); |
197 | 203 |
|
198 | 204 | SET_PROFILE.accept(meta, gameProfile); |
199 | 205 | } catch (Exception e) { |
|
0 commit comments