summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-10-03 17:10:27 +0200
committerNassim Jahnke <[email protected]>2024-10-03 17:10:27 +0200
commit7cd4f2c15fbd12637c2161779986f8b56aa0a59e (patch)
tree6b339d4b6fc7df9318edeae48794030f1c4b2f1a
parentfb768404aa8bdd35b95c88132b95f5cb529cc098 (diff)
downloadPaper-7cd4f2c15fbd12637c2161779986f8b56aa0a59e.tar.gz
Paper-7cd4f2c15fbd12637c2161779986f8b56aa0a59e.zip
Check if leash tag has a uuid
-rw-r--r--patches/server/0918-Validate-ResourceLocation-in-NBT-reading.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0918-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0918-Validate-ResourceLocation-in-NBT-reading.patch
index 48e7f7dede..923bdbe37d 100644
--- a/patches/server/0918-Validate-ResourceLocation-in-NBT-reading.patch
+++ b/patches/server/0918-Validate-ResourceLocation-in-NBT-reading.patch
@@ -65,6 +65,25 @@ index b98f9246b60daf31460f41ce214dfa7c011f5684..842b0cec0397d7ae5166617627340ffa
}
@Nullable
+diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
+index e7535f15be3cc1537aafee53779ccfb4f21d1f38..bd6d587cedfe0e345536d7ebb6b7ca204f073efe 100644
+--- a/src/main/java/net/minecraft/world/entity/Leashable.java
++++ b/src/main/java/net/minecraft/world/entity/Leashable.java
+@@ -54,7 +54,13 @@ public interface Leashable {
+ @Nullable
+ default Leashable.LeashData readLeashData(CompoundTag nbt) {
+ if (nbt.contains("leash", 10)) {
+- return new Leashable.LeashData(Either.left(nbt.getCompound("leash").getUUID("UUID")));
++ // Paper start
++ final CompoundTag leashTag = nbt.getCompound("leash");
++ if (!leashTag.hasUUID("UUID")) {
++ return null;
++ }
++ return new Leashable.LeashData(Either.left(leashTag.getUUID("UUID")));
++ // Paper end
+ } else {
+ if (nbt.contains("leash", 11)) {
+ Either<UUID, BlockPos> either = (Either) NbtUtils.readBlockPos(nbt, "leash").map(Either::right).orElse(null); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 13ef1ad250b56dbadba0244186e369d7ba9b5c0e..94169703c5a8111df1ed550d57f59f4a3bb97ae1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java