Low-Drag-MC / LDLib-Architectury

GNU General Public License v3.0
12 stars 13 forks source link

Stack Size not displayed on SlotWidget #5

Closed mikerooni closed 1 year ago

mikerooni commented 1 year ago

When a SlotWidget or PhantomSlotWidget contains more than a single item, the stack size is not being displayed.

Example Usage

@Override
public Widget createUIWidget() {
    final var group = new WidgetGroup(0, 0, 176, 135);

    var handler = new ItemStackTransfer(1);
    var slot = new PhantomSlotWidget(handler, 0, 10, 10);
    slot.setMaxStackSize(64);
    slot.setChangeListener(() -> {
        System.out.println("stack: " + handler.getStackInSlot(0));
    }).setBackground(GuiTextures.SLOT);
    group.addWidget(slot);

    return group;
}

Expected Behavior

When the stack inside the SlotWidget or PhantomSlotWidget is larger than 1, its size should be displayed like in regular item slots.

Actual Behavior

No matter how large the contained ItemStack is, the SlotWidget does not show the size. It is always displayed as if there was only a single item in the slot.

All other behavior works fine, just as expected:

mikerooni commented 1 year ago

Not a bug in LDLib, it only affects side panels in GTCEu-Modern