2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Tue, 24 Sep 2019 16:03:00 -0700
|
|
|
|
Subject: [PATCH] Fix MC-161754
|
|
|
|
|
|
|
|
Fixes https://github.com/PaperMC/Paper/issues/2580
|
|
|
|
|
|
|
|
We can use an entity valid check since this method is invoked for
|
|
|
|
each inventory iteraction (thanks to CB) and on player tick (vanilla).
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/HorseInventoryMenu.java b/src/main/java/net/minecraft/world/inventory/HorseInventoryMenu.java
|
2021-07-07 08:52:40 +02:00
|
|
|
index f3e17f00f09feb4df4274b09bc7fa3c3022a5fbb..ffc596d8db77aaeed43f79b895bf4a1c7baeeab2 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/inventory/HorseInventoryMenu.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/inventory/HorseInventoryMenu.java
|
2021-06-13 21:29:58 +02:00
|
|
|
@@ -95,7 +95,7 @@ public class HorseInventoryMenu extends AbstractContainerMenu {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean stillValid(Player player) {
|
2021-06-13 21:29:58 +02:00
|
|
|
- return !this.horse.hasInventoryChanged(this.horseContainer) && this.horseContainer.stillValid(player) && this.horse.isAlive() && this.horse.distanceTo((Entity) player) < 8.0F;
|
|
|
|
+ return !this.horse.hasInventoryChanged(this.horseContainer) && this.horseContainer.stillValid(player) && (this.horse.isAlive() && this.horse.valid) && this.horse.distanceTo((Entity) player) < 8.0F; // Paper - Fix MC-161754
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
2021-07-07 08:52:40 +02:00
|
|
|
private boolean hasChest(AbstractHorse horse) {
|