2021-08-07 02:35:42 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
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
|
2021-08-25 09:59:26 +02:00
|
|
|
index 08c4a0996410a42418d4a5da3ed1f4db2f171dd2..d41851f9119c334cae3fc2c433d6450a3eed9096 100644
|
2021-08-07 02:35:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
2021-08-25 09:59:26 +02:00
|
|
|
@@ -599,7 +599,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
2021-08-07 02:35:42 +02:00
|
|
|
stack = ItemStack.EMPTY;
|
|
|
|
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
|
|
|
|
int k = Math.min(stack.getCount(), j);
|
|
|
|
|
|
|
|
stack.shrink(k);
|