Skip to content

Commit 5e3b7ac

Browse files
committed
Fogor some if statements
1 parent 6086da9 commit 5e3b7ac

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityMachineHatch.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager)
9393
tooltip.markDirty();
9494
}
9595
})
96-
.overlay((context, x, y, width, height, widgetTheme) -> GuiDraw.drawRect(x, y, width, height,
97-
0x80404040))
96+
.overlay((context, x, y, width, height, widgetTheme) -> {
97+
if (isSlotBlocked()) {
98+
GuiDraw.drawRect(x, y, width, height, 0x80404040);
99+
}
100+
})
98101
.left(79).top(18));
99102
}
100103

src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityObjectHolder.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,22 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager)
8181
.slotGroup("item_inv")
8282
.filter(itemStack -> !isSlotBlocked()))
8383
.background(GTGuiTextures.SLOT, GTGuiTextures.RESEARCH_STATION_OVERLAY)
84-
.overlay((context, x, y, width, height, widgetTheme) -> GuiDraw.drawRect(x, y, width, height,
85-
0x80404040))
84+
.overlay((context, x, y, width, height, widgetTheme) -> {
85+
if (isSlotBlocked()) {
86+
GuiDraw.drawRect(x, y, width, height, 0x80404040);
87+
}
88+
})
8689
.left(79).top(39))
8790
.child(new ItemSlot()
8891
.slot(SyncHandlers.itemSlot(heldItems, 1)
8992
.slotGroup("item_inv")
9093
.filter(itemStack -> !isSlotBlocked()))
9194
.background(GTGuiTextures.SLOT, GTGuiTextures.DATA_ORB_OVERLAY)
92-
.overlay((context, x, y, width, height, widgetTheme) -> GuiDraw.drawRect(x, y, width, height,
93-
0x80404040))
95+
.overlay((context, x, y, width, height, widgetTheme) -> {
96+
if (isSlotBlocked()) {
97+
GuiDraw.drawRect(x, y, width, height, 0x80404040);
98+
}
99+
})
94100
.left(15).top(39));
95101
}
96102

0 commit comments

Comments
 (0)