Validate ResourceLocation in NBT reading
This commit is contained in:
parent
01a7a72224
commit
0f3d126ce1
2 changed files with 68 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue