Skip to content

Commit

Permalink
Merge Paper #11945 for temporary hooper behavior fix
Browse files Browse the repository at this point in the history
A hopper optimization fix on Paper's pr : PaperMC/Paper#11945
  • Loading branch information
MrHua269 committed Jan 11, 2025
1 parent b33e2fc commit c0f2000
Show file tree
Hide file tree
Showing 32 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sat, 11 Jan 2025 18:41:11 +0800
Subject: [PATCH] Merge Paper #11945 for temporary hooper behavior fix

A hopper optimization fix on Paper's pr : https://github.com/PaperMC/Paper/pull/11945

diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index 44aae845da6cd34fc00e0c71795d6f610679bd4b..f0c2dae36d944f769082904301bcba91f2d0895f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -764,8 +764,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
} else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) {
int j = Math.min(stack.getMaxStackSize(), to.getMaxStackSize()) - itemstack1.getCount(); // Paper - Make hoppers respect inventory max stack size
int k = Math.min(stack.getCount(), j);
-
- stack.shrink(k);
+ stack.copy(true).shrink(k); // Paper - Perf: Optimize Hoppers
itemstack1.grow(k);
flag = k > 0;
}
File renamed without changes.
File renamed without changes.

0 comments on commit c0f2000

Please sign in to comment.