-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Paper #11945 for temporary hooper behavior fix
A hopper optimization fix on Paper's pr : PaperMC/Paper#11945
- Loading branch information
Showing
32 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
patches/server/0027-Merge-Paper-11945-for-temporary-hooper-behavior-fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.