Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.component.DataComponents;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
Expand Down Expand Up @@ -59,7 +60,8 @@ public class DepotBehaviour extends BlockEntityBehaviour implements Clearable {

public DepotBehaviour(SmartBlockEntity be) {
super(be);
maxStackSize = () -> heldItem != null ? heldItem.stack.getMaxStackSize() : 64;
maxStackSize = () -> heldItem != null ?
heldItem.stack.getOrDefault(DataComponents.MAX_STACK_SIZE, 64) : 64;
canAcceptItems = () -> true;
canFunnelsPullFrom = $ -> true;
acceptedItems = $ -> true;
Expand Down Expand Up @@ -273,8 +275,8 @@ public int getRemainingSpace() {
int cumulativeStackSize = getPresentStackSize();
for (TransportedItemStack transportedItemStack : incoming)
cumulativeStackSize += transportedItemStack.stack.getCount();
int fromGetter =
Math.min(maxStackSize.get() == 0 ? 64 : maxStackSize.get(), getHeldItemStack().getMaxStackSize());
int fromGetter = Math.min(maxStackSize.get() == 0 ? 64 : maxStackSize.get(),
getHeldItemStack().getOrDefault(DataComponents.MAX_STACK_SIZE, 64));
return (fromGetter) - cumulativeStackSize;
}

Expand Down
Loading