Skip to content

Commit

Permalink
Fix Output Bus not Notifying in Certain Conditions (#2558)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude authored Aug 2, 2024
1 parent 520a05e commit 427867f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public GTItemStackHandler(MetaTileEntity metaTileEntity, NonNullList<ItemStack>
}

@Override
protected void onContentsChanged(int slot) {
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
metaTileEntity.markDirty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,18 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager)
for (int i = 0; i < rowSize; i++) {
widgets.add(new ArrayList<>());
for (int j = 0; j < rowSize; j++) {
int index = i * rowSize + j;
IItemHandlerModifiable handler = isExportHatch ? exportItems : importItems;
widgets.get(i)
.add(new ItemSlot()
.slot(SyncHandlers.itemSlot(isExportHatch ? exportItems : importItems, i * rowSize + j)
.slot(SyncHandlers.itemSlot(handler, index)
.slotGroup("item_inv")
.changeListener((newItem, onlyAmountChanged, client, init) -> {
if (onlyAmountChanged &&
handler instanceof GTItemStackHandler gtHandler) {
gtHandler.onContentsChanged(index);
}
})
.accessibility(!isExportHatch, true)));
}
}
Expand Down

0 comments on commit 427867f

Please sign in to comment.