From e3d7b6dab0a310788c2e055685bbf377b2451cc8 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 17 Aug 2026 01:49:42 +0800 Subject: [PATCH 1/4] Fix bookshelf item loss with use-vanilla-hopper --- .../features/0305-Leaves-Vanilla-hopper.patch | 10 ++++++++-- ...Replace-Lithium-tracker-list-with-array.patch | 16 ++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch index 8ca324e5c..f01c32bd5 100644 --- a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch +++ b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch @@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium. diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index dab2778068afa42ad8719300852b4ac8495a2a09..e1cf1057e9dd6cc859621d791ec62bbb2bcff04b 100644 +index dab2778068afa42ad8719300852b4ac8495a2a09..ea0cb436d42980ba996adfd660430e167e7c8324 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -281,36 +281,67 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -281,36 +281,73 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ItemStack movedItem = origItemStack; final int originalItemCount = origItemStack.getCount(); final int movedItemCount = Math.min(level.spigotConfig.hopperAmount, originalItemCount); @@ -46,6 +46,12 @@ index dab2778068afa42ad8719300852b4ac8495a2a09..e1cf1057e9dd6cc859621d791ec62bbb - // site for IMIE did not exhibit the same behavior + final int itemCountToMove = movedItem.getCount(); + final ItemStack remainingItem = addItem(container, hopper, movedItem, null); ++ // Leaf start - fix aliased item loss (e.g. chiseled bookshelf) ++ if (removeOriginalItem && remainingItem.isEmpty()) { ++ container.setChanged(); ++ return true; ++ } ++ // Leaf end - fix aliased item loss (e.g. chiseled bookshelf) + if (remainingItem.getCount() != itemCountToMove) { + origItemStack.setCount(removeOriginalItem ? originalItemCount - movedItemCount : originalItemCount); + container.setItem(i, origItemStack); diff --git a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch index de3e8ab33..a20db69f5 100644 --- a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch +++ b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Replace Lithium tracker list with array diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec385192a46f4f 100644 +index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f05b5f7bf 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -869,21 +869,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -875,21 +875,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen //Mod count used to avoid transfer attempts that are known to fail (no change since last attempt) private long insertStackListModCount, extractStackListModCount; @@ -33,7 +33,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 @Nullable private AABB insertInventoryEntityBox; private long insertInventoryEntityFailedSearchTime; -@@ -965,19 +962,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -971,19 +968,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ((net.caffeinemc.mods.lithium.common.block.entity.inventory_change_tracking.InventoryChangeTracker) this.insertBlockInventory).listenForContentChangesOnce(this.insertStackList, this); } if (listenToInsertEntities) { @@ -56,7 +56,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 return; } net.caffeinemc.mods.lithium.common.tracking.entity.ChunkSectionEntityMovementTracker.listenToEntityMovementOnce(this, collectItemEntityTracker); -@@ -1112,7 +1109,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1118,7 +1115,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateInsertionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.insertInventoryEntityTracker != null) { @@ -65,7 +65,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 this.insertInventoryEntityTracker = null; this.insertInventoryEntityBox = null; this.insertInventoryEntityFailedSearchTime = 0L; -@@ -1140,13 +1137,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1146,13 +1143,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateExtractionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.extractInventoryEntityTracker != null) { @@ -81,7 +81,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 this.collectItemEntityTracker = null; this.collectItemEntityBox = null; this.collectItemEntityTrackerWasEmpty = false; -@@ -1282,7 +1279,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1288,7 +1285,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.insertInventoryEntityTracker == null) { this.initInsertInventoryTracker(world); } @@ -90,7 +90,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 this.insertInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1347,7 +1344,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1353,7 +1350,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.extractInventoryEntityTracker == null) { this.initExtractInventoryTracker(level); } @@ -99,7 +99,7 @@ index e1cf1057e9dd6cc859621d791ec62bbb2bcff04b..0a622da1b4510922c60e36b587ec3851 this.extractInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1467,7 +1464,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1473,7 +1470,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen long modCount = net.caffeinemc.mods.lithium.common.hopper.InventoryHelper.getLithiumStackList(hopperBlockEntity).getModCount(); if ((hopperBlockEntity.collectItemEntityTrackerWasEmpty || hopperBlockEntity.myModCountAtLastItemCollect == modCount) && From 2790be904b55ae2262cbc91cc45c7b5b1190de06 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Tue, 18 Aug 2026 20:59:31 +0800 Subject: [PATCH 2/4] Fix item loss with use-vanilla-hopper --- .../features/0305-Leaves-Vanilla-hopper.patch | 11 +++-------- ...Replace-Lithium-tracker-list-with-array.patch | 16 ++++++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch index f01c32bd5..7a14da384 100644 --- a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch +++ b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch @@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium. diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index dab2778068afa42ad8719300852b4ac8495a2a09..ea0cb436d42980ba996adfd660430e167e7c8324 100644 +index dab2778068afa42ad8719300852b4ac8495a2a09..b309946226f214ac2013667e5b0fce2257229475 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -281,36 +281,73 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -281,36 +281,68 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ItemStack movedItem = origItemStack; final int originalItemCount = origItemStack.getCount(); final int movedItemCount = Math.min(level.spigotConfig.hopperAmount, originalItemCount); @@ -35,6 +35,7 @@ index dab2778068afa42ad8719300852b4ac8495a2a09..ea0cb436d42980ba996adfd660430e16 + final boolean removeOriginalItem = movedItem == origItemStack; + if (removeOriginalItem) { + movedItem = container.removeItem(i, movedItemCount); ++ movedItem = movedItem.copy(true); // Leaf - avoid write-back clearing the inserted stack (aliased removeItem) + } - if (!skipPullModeEventFire) { @@ -46,12 +47,6 @@ index dab2778068afa42ad8719300852b4ac8495a2a09..ea0cb436d42980ba996adfd660430e16 - // site for IMIE did not exhibit the same behavior + final int itemCountToMove = movedItem.getCount(); + final ItemStack remainingItem = addItem(container, hopper, movedItem, null); -+ // Leaf start - fix aliased item loss (e.g. chiseled bookshelf) -+ if (removeOriginalItem && remainingItem.isEmpty()) { -+ container.setChanged(); -+ return true; -+ } -+ // Leaf end - fix aliased item loss (e.g. chiseled bookshelf) + if (remainingItem.getCount() != itemCountToMove) { + origItemStack.setCount(removeOriginalItem ? originalItemCount - movedItemCount : originalItemCount); + container.setItem(i, origItemStack); diff --git a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch index a20db69f5..8f281b761 100644 --- a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch +++ b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Replace Lithium tracker list with array diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f05b5f7bf 100644 +index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f3eaa05c4 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -875,21 +875,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -870,21 +870,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen //Mod count used to avoid transfer attempts that are known to fail (no change since last attempt) private long insertStackListModCount, extractStackListModCount; @@ -33,7 +33,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f @Nullable private AABB insertInventoryEntityBox; private long insertInventoryEntityFailedSearchTime; -@@ -971,19 +968,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -966,19 +963,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ((net.caffeinemc.mods.lithium.common.block.entity.inventory_change_tracking.InventoryChangeTracker) this.insertBlockInventory).listenForContentChangesOnce(this.insertStackList, this); } if (listenToInsertEntities) { @@ -56,7 +56,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f return; } net.caffeinemc.mods.lithium.common.tracking.entity.ChunkSectionEntityMovementTracker.listenToEntityMovementOnce(this, collectItemEntityTracker); -@@ -1118,7 +1115,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1113,7 +1110,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateInsertionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.insertInventoryEntityTracker != null) { @@ -65,7 +65,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f this.insertInventoryEntityTracker = null; this.insertInventoryEntityBox = null; this.insertInventoryEntityFailedSearchTime = 0L; -@@ -1146,13 +1143,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1141,13 +1138,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateExtractionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.extractInventoryEntityTracker != null) { @@ -81,7 +81,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f this.collectItemEntityTracker = null; this.collectItemEntityBox = null; this.collectItemEntityTrackerWasEmpty = false; -@@ -1288,7 +1285,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1283,7 +1280,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.insertInventoryEntityTracker == null) { this.initInsertInventoryTracker(world); } @@ -90,7 +90,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f this.insertInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1353,7 +1350,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1348,7 +1345,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.extractInventoryEntityTracker == null) { this.initExtractInventoryTracker(level); } @@ -99,7 +99,7 @@ index ea0cb436d42980ba996adfd660430e167e7c8324..7ef954494de911a26cfad9f6db94513f this.extractInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1473,7 +1470,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1468,7 +1465,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen long modCount = net.caffeinemc.mods.lithium.common.hopper.InventoryHelper.getLithiumStackList(hopperBlockEntity).getModCount(); if ((hopperBlockEntity.collectItemEntityTrackerWasEmpty || hopperBlockEntity.myModCountAtLastItemCollect == modCount) && From 846638dddd920b2b587fca8566e2100ca3b27ec4 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Tue, 18 Aug 2026 21:08:25 +0800 Subject: [PATCH 3/4] Simplify hopper write-back copy comment --- .../features/0305-Leaves-Vanilla-hopper.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch index 7a14da384..bd7f26ffb 100644 --- a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch +++ b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch @@ -9,7 +9,7 @@ Original project: https://github.com/LeavesMC/Leaves This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium. diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index dab2778068afa42ad8719300852b4ac8495a2a09..b309946226f214ac2013667e5b0fce2257229475 100644 +index dab2778068afa42ad8719300852b4ac8495a2a09..c7129e606dc44dd3d4928c46e29d0636dea2ca22 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -281,36 +281,68 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -35,7 +35,7 @@ index dab2778068afa42ad8719300852b4ac8495a2a09..b309946226f214ac2013667e5b0fce22 + final boolean removeOriginalItem = movedItem == origItemStack; + if (removeOriginalItem) { + movedItem = container.removeItem(i, movedItemCount); -+ movedItem = movedItem.copy(true); // Leaf - avoid write-back clearing the inserted stack (aliased removeItem) ++ movedItem = movedItem.copy(true); // copy if reference equal + } - if (!skipPullModeEventFire) { From ed88dc4198f0b5a86048759f7699a27bf02d1009 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Fri, 21 Aug 2026 03:50:08 +0800 Subject: [PATCH 4/4] Only copy source stack when removeItem returns a shared reference --- .../features/0305-Leaves-Vanilla-hopper.patch | 8 +++++--- ...Replace-Lithium-tracker-list-with-array.patch | 16 ++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch index bd7f26ffb..0d1d821d0 100644 --- a/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch +++ b/leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch @@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium. diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index dab2778068afa42ad8719300852b4ac8495a2a09..c7129e606dc44dd3d4928c46e29d0636dea2ca22 100644 +index dab2778068afa42ad8719300852b4ac8495a2a09..c3b9880f125aee88f671f5e527043676b70bca4a 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -281,36 +281,68 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -281,36 +281,70 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ItemStack movedItem = origItemStack; final int originalItemCount = origItemStack.getCount(); final int movedItemCount = Math.min(level.spigotConfig.hopperAmount, originalItemCount); @@ -35,7 +35,9 @@ index dab2778068afa42ad8719300852b4ac8495a2a09..c7129e606dc44dd3d4928c46e29d0636 + final boolean removeOriginalItem = movedItem == origItemStack; + if (removeOriginalItem) { + movedItem = container.removeItem(i, movedItemCount); -+ movedItem = movedItem.copy(true); // copy if reference equal ++ if (movedItem == origItemStack) { ++ movedItem = movedItem.copy(true); // copy if reference equal ++ } + } - if (!skipPullModeEventFire) { diff --git a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch index 8f281b761..81dc4a004 100644 --- a/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch +++ b/leaf-server/minecraft-patches/features/0311-Replace-Lithium-tracker-list-with-array.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Replace Lithium tracker list with array diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f3eaa05c4 100644 +index c3b9880f125aee88f671f5e527043676b70bca4a..3162c02847a818afa2b9f873f4a75bc87db52e79 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -870,21 +870,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -872,21 +872,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen //Mod count used to avoid transfer attempts that are known to fail (no change since last attempt) private long insertStackListModCount, extractStackListModCount; @@ -33,7 +33,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f @Nullable private AABB insertInventoryEntityBox; private long insertInventoryEntityFailedSearchTime; -@@ -966,19 +963,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -968,19 +965,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ((net.caffeinemc.mods.lithium.common.block.entity.inventory_change_tracking.InventoryChangeTracker) this.insertBlockInventory).listenForContentChangesOnce(this.insertStackList, this); } if (listenToInsertEntities) { @@ -56,7 +56,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f return; } net.caffeinemc.mods.lithium.common.tracking.entity.ChunkSectionEntityMovementTracker.listenToEntityMovementOnce(this, collectItemEntityTracker); -@@ -1113,7 +1110,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1115,7 +1112,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateInsertionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.insertInventoryEntityTracker != null) { @@ -65,7 +65,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f this.insertInventoryEntityTracker = null; this.insertInventoryEntityBox = null; this.insertInventoryEntityFailedSearchTime = 0L; -@@ -1141,13 +1138,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1143,13 +1140,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen private void invalidateExtractionData() { if (this.level instanceof net.minecraft.server.level.ServerLevel) { if (this.extractInventoryEntityTracker != null) { @@ -81,7 +81,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f this.collectItemEntityTracker = null; this.collectItemEntityBox = null; this.collectItemEntityTrackerWasEmpty = false; -@@ -1283,7 +1280,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1285,7 +1282,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.insertInventoryEntityTracker == null) { this.initInsertInventoryTracker(world); } @@ -90,7 +90,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f this.insertInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1348,7 +1345,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1350,7 +1347,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (this.extractInventoryEntityTracker == null) { this.initExtractInventoryTracker(level); } @@ -99,7 +99,7 @@ index b309946226f214ac2013667e5b0fce2257229475..24b2af29a176494f5d224af9b4e86a2f this.extractInventoryEntityFailedSearchTime = this.tickedGameTime; return null; } -@@ -1468,7 +1465,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -1470,7 +1467,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen long modCount = net.caffeinemc.mods.lithium.common.hopper.InventoryHelper.getLithiumStackList(hopperBlockEntity).getModCount(); if ((hopperBlockEntity.collectItemEntityTrackerWasEmpty || hopperBlockEntity.myModCountAtLastItemCollect == modCount) &&