Skip to content

Commit

Permalink
Fixed issue #253 caused by stackable Shulker Box feature, functionali…
Browse files Browse the repository at this point in the history
…ty restored
  • Loading branch information
MC-XiaoHei committed Jul 12, 2024
1 parent c618026 commit 6acec7a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions patches/server/0042-Stackable-ShulkerBoxes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ index 845eff7401b811c179dc9dee70eca0d724be5c80..c88b98bd4ebec40649b9cfcf47ca2035

default SlotAccess getChestVehicleSlot(int slot) {
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index 961a7193fda00fa62acea9c39fda1c93f7fbe412..7126fd4cf1f27aa75b6876051c3e884b79db8410 100644
index 961a7193fda00fa62acea9c39fda1c93f7fbe412..11bb1168f27a3a95b5e88f106e070a482702d50d 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -456,7 +456,7 @@ public abstract class AbstractContainerMenu {
Expand Down Expand Up @@ -236,24 +236,22 @@ index 961a7193fda00fa62acea9c39fda1c93f7fbe412..7126fd4cf1f27aa75b6876051c3e884b
while (!stack.isEmpty()) {
if (fromLast) {
if (k < startIndex) {
@@ -824,7 +824,7 @@ public abstract class AbstractContainerMenu {
@@ -824,6 +824,7 @@ public abstract class AbstractContainerMenu {
// Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(stack, itemstack1)) {
l = itemstack1.getCount() + stack.getCount();
- int i1 = slot.getMaxStackSize(itemstack1);
+ int i1 = org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemstack1); // Leaves - stackable shulker boxes
+ // int i1 = org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemstack1); // Leaves - stackable shulker boxes // disabled temporarily
int i1 = slot.getMaxStackSize(itemstack1);

if (l <= i1) {
stack.setCount(0);
@@ -875,7 +875,7 @@ public abstract class AbstractContainerMenu {
@@ -875,6 +876,7 @@ public abstract class AbstractContainerMenu {
}
// Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
if (itemstack1.isEmpty() && slot.mayPlace(stack)) {
- l = slot.getMaxStackSize(stack);
+ l = org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemstack1); // Leaves - stackable shulker boxes
+ // l = org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemstack1); // Leaves - stackable shulker boxes // disabled temporarily
l = slot.getMaxStackSize(stack);
// Paper start - Add PlayerTradeEvent and PlayerPurchaseEvent
if (isCheck) {
stack.shrink(Math.min(stack.getCount(), l));
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java
index 9140fab07aab32065f7a3b5d13dd17d61dc6d646..210b88b5d87fad641188cf5907c54824d21163ce 100644
--- a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java
Expand Down

0 comments on commit 6acec7a

Please sign in to comment.