From 624d28817cfccdb9e85302a02a782a5331877266 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Tue, 7 May 2024 14:28:45 +0200
Subject: [PATCH] Fix hopper pull event being skipped after the first call
 (#10667)

---
 patches/server/Optimize-Hoppers.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/patches/server/Optimize-Hoppers.patch b/patches/server/Optimize-Hoppers.patch
index df3570c495..8a331095ea 100644
--- a/patches/server/Optimize-Hoppers.patch
+++ b/patches/server/Optimize-Hoppers.patch
@@ -470,6 +470,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          return true;
      }
  
+@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
+ 
+         if (iinventory != null) {
+             Direction enumdirection = Direction.DOWN;
++            skipPullModeEventFire = skipHopperEvents; // Paper - Perf: Optimize Hoppers
+             int[] aint = HopperBlockEntity.getSlots(iinventory, enumdirection);
+             int i = aint.length;
+ 
 @@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
          ItemStack itemstack = iinventory.getItem(i);