This commit is contained in:
zly2006 committed 2024-07-11 12:14:02 +08:00
1 parent 9c63e6e62e
commit 3e7b817cd4
1 file changed
+14
@@ -25,6 +25,20 @@ public abstract class MixinPlayerInventory implements Inventory {
return instance.isStackable(); return instance.isStackable();
} }
@Redirect(
method = "offer",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/item/ItemStack;getMaxCount()I"
)
)
private int redirectMaxCount(ItemStack stack) {
if (SLSCarpetSettings.emptyShulkerBoxStack && ShulkerBoxItemUtil.isEmptyShulkerBoxItem(stack)) {
return ShulkerBoxItemUtil.SHULKERBOX_MAX_STACK_AMOUNT;
}
return Inventory.super.getMaxCount(stack);
}
@Override @Override
public int getMaxCount(ItemStack stack) { public int getMaxCount(ItemStack stack) {
if (SLSCarpetSettings.emptyShulkerBoxStack && ShulkerBoxItemUtil.isEmptyShulkerBoxItem(stack)) { if (SLSCarpetSettings.emptyShulkerBoxStack && ShulkerBoxItemUtil.isEmptyShulkerBoxItem(stack)) {