mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 07:20:00 +08:00
Fix upstreams fix for composters and variable hoppers (#6563)
This commit is contained in:
parent
6084ac368f
commit
655cd8f638
@ -5,11 +5,24 @@ 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
|
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 08c4a0996410a42418d4a5da3ed1f4db2f171dd2..d41851f9119c334cae3fc2c433d6450a3eed9096 100644
|
index 08c4a0996410a42418d4a5da3ed1f4db2f171dd2..4950d49ed414e1c82c125b9347113f595f1078b6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -599,7 +599,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -589,17 +589,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
stack = ItemStack.EMPTY;
|
|
||||||
|
if (itemstack1.isEmpty()) {
|
||||||
|
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
|
||||||
|
+ ItemStack leftover = ItemStack.EMPTY; // Paper
|
||||||
|
if (!stack.isEmpty() && stack.getCount() > to.getMaxStackSize()) {
|
||||||
|
+ leftover = stack; // Paper
|
||||||
|
stack = stack.split(to.getMaxStackSize());
|
||||||
|
}
|
||||||
|
// Spigot end
|
||||||
|
IGNORE_TILE_UPDATES = true; // Paper
|
||||||
|
to.setItem(slot, stack);
|
||||||
|
IGNORE_TILE_UPDATES = false; // Paper
|
||||||
|
- stack = ItemStack.EMPTY;
|
||||||
|
+ stack = leftover; // Paper
|
||||||
flag = true;
|
flag = true;
|
||||||
} else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) {
|
} else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) {
|
||||||
- int j = stack.getMaxStackSize() - itemstack1.getCount();
|
- int j = stack.getMaxStackSize() - itemstack1.getCount();
|
||||||
|
Loading…
Reference in New Issue
Block a user