mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Validate ResourceLocation in NBT reading
This commit is contained in:
@@ -53,11 +53,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@Nullable
|
||||
public static GameProfile readGameProfile(CompoundTag nbt) {
|
||||
UUID uUID = nbt.hasUUID("Id") ? nbt.getUUID("Id") : Util.NIL_UUID;
|
||||
+ // Paper start - support string UUID's
|
||||
+ // Paper start - Support string UUIDs
|
||||
+ if (nbt.contains("Id", Tag.TAG_STRING)) {
|
||||
+ uUID = UUID.fromString(nbt.getString("Id"));
|
||||
+ try {
|
||||
+ uUID = UUID.fromString(nbt.getString("Id"));
|
||||
+ } catch (IllegalArgumentException ignored){
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ // Paper end - Support string UUIDs
|
||||
String string = nbt.getString("Name");
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user