mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 19:52:55 +01:00
275173e538
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 0c5d8709 SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends 255c4fdb SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot CraftBukkit Changes: b6b514b7e SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends fcff84de9 SPIGOT-7399: Revert null check in CraftMetaItem#safelyAdd 44a4b5649 SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot 676969d01 SPIGOT-7389: Handle setting null items in ChiseledBookshelf Inventory
30 lines
1.7 KiB
Diff
30 lines
1.7 KiB
Diff
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
|
|
index 73e505630e8a702e0c46e042c478a9c9c246856c..6907e647ef4d3f5c9c46edb4cf0905844dd1cea9 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
|
|
@@ -436,15 +436,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
|
|
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
|
|
to.setItem(slot, stack);
|
|
- stack = ItemStack.EMPTY;
|
|
+ stack = leftover; // Paper
|
|
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);
|