From 777073a54d367761bf9112457c4fa2eca2d0fe9b Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 24 Sep 2019 16:16:16 -0700 Subject: [PATCH] Check horse entity validity in container interactions (#2584) Fixes #2580 --- .../0419-Fix-MC-161754.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Spigot-Server-Patches/0419-Fix-MC-161754.patch diff --git a/Spigot-Server-Patches/0419-Fix-MC-161754.patch b/Spigot-Server-Patches/0419-Fix-MC-161754.patch new file mode 100644 index 0000000000..54c31879b3 --- /dev/null +++ b/Spigot-Server-Patches/0419-Fix-MC-161754.patch @@ -0,0 +1,26 @@ +From bd880ec25fa3db73d596f3307f8b36dc5eb8f701 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +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/server/ContainerHorse.java b/src/main/java/net/minecraft/server/ContainerHorse.java +index d1b9482d6..ad4e0a45c 100644 +--- a/src/main/java/net/minecraft/server/ContainerHorse.java ++++ b/src/main/java/net/minecraft/server/ContainerHorse.java +@@ -76,7 +76,7 @@ public class ContainerHorse extends Container { + + @Override + public boolean canUse(EntityHuman entityhuman) { +- return this.c.a(entityhuman) && this.d.isAlive() && this.d.g((Entity) entityhuman) < 8.0F; ++ return this.c.a(entityhuman) && (this.d.isAlive() && this.d.valid) && this.d.g((Entity) entityhuman) < 8.0F; // Paper - Fix MC-161754 + } + + @Override +-- +2.22.1 +