mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
Check if leash tag has a uuid
This commit is contained in:
parent
fb768404aa
commit
7cd4f2c15f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user