aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-06-16 12:56:00 +0200
committerNassim Jahnke <[email protected]>2024-06-16 12:56:00 +0200
commitdc684c60d16f66ea84467ec8e253f2a36a17a7c8 (patch)
treee516f1bd4bfbdb37a5aeee42384aade111eca3e1 /patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch
parent752f957e12e4ceb8b7d2043a4a7dbce786b7b98f (diff)
downloadPaper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.tar.gz
Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.zip
Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
Diffstat (limited to 'patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch')
-rw-r--r--patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch
new file mode 100644
index 0000000000..c5f669b979
--- /dev/null
+++ b/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Wed, 7 Jul 2021 16:30:17 -0700
+Subject: [PATCH] Make hoppers respect inventory max stack size
+
+
+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 dfb57192105d5e05e4c2e32da5eadb7c701a763a..92086ca118d55ec49cefa5bf18977f8706e3e4b4 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
+@@ -485,15 +485,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
+
+ if (itemstack1.isEmpty()) {
+ // Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
++ ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
+ if (!stack.isEmpty() && stack.getCount() > to.getMaxStackSize()) {
++ leftover = stack; // Paper - Make hoppers respect inventory max stack size
+ stack = stack.split(to.getMaxStackSize());
+ }
+ // Spigot end
+ to.setItem(slot, stack);
+- stack = ItemStack.EMPTY;
++ stack = leftover; // Paper - Make hoppers respect inventory max stack size
+ flag = true;
+ } else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) {
+- int j = stack.getMaxStackSize() - itemstack1.getCount();
++ 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);