Fix leashed pets teleporting to owner when loaded (#9686)

This commit is contained in:
Warrior 2023-09-17 01:16:44 +03:00 committed by GitHub
parent e312ebb1bd
commit 06a741d713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,6 +57,12 @@ https://bugs.mojang.com/browse/MC-84789
https://bugs.mojang.com/browse/MC-225381 https://bugs.mojang.com/browse/MC-225381
Fix overfilled bundles duplicating items / being filled with air Fix overfilled bundles duplicating items / being filled with air
https://bugs.mojang.com/browse/MC-173303
Fix leashed pets teleporting to owner when loaded
== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com> Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@ -198,6 +204,19 @@ index b0caf52d00d8cd76550ab116291f8e11144a5e59..93bbda61f0eb2dd52573602b1f9cc7b0
if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) { if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) {
return false; return false;
} else { } else {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
index 11cc26954b4e97114b59df35a4f9b75a09132e20..0a3f7dcc0e205a85dbaa6dee1fc9ae2c7fa9e02d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
@@ -74,7 +74,7 @@ public class FollowOwnerGoal extends Goal {
}
private boolean unableToMove() {
- return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed();
+ return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed() || this.tamable.leashInfoTag != null; // Paper - Fix MC-173303
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java
index 19540fd4a7f992888fadb6501d0c8a5a7e71fcf6..e241ae250f4f04a17ef2c583d00b065a4ca56a4c 100644 index 19540fd4a7f992888fadb6501d0c8a5a7e71fcf6..e241ae250f4f04a17ef2c583d00b065a4ca56a4c 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java