@@ -91,6 +91,9 @@ public class ContainerScreenTerminalStorage<L, C extends ContainerTerminalStorag
9191 private boolean clicked ;
9292 protected boolean swallowNextCharacter = false ;
9393
94+ private int lastMouseX ;
95+ private int lastMouseY ;
96+
9497 public ContainerScreenTerminalStorage (C container , Inventory inventory , Component title ) {
9598 super (container , inventory , title );
9699 container .selectedClientTabProvider = this ;
@@ -382,7 +385,8 @@ protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
382385 drawTabsForeground (guiGraphics , mouseX , mouseY );
383386 drawTabContents (guiGraphics , getMenu ().getSelectedTab (), getMenu ().getSelectedChannel (), DrawLayer .FOREGROUND ,
384387 0 , getSlotsOffsetX (), getSlotsOffsetY (), mouseX , mouseY );
385- drawActiveStorageSlotItem (guiGraphics , mouseX , mouseY );
388+ this .lastMouseX = mouseX ;
389+ this .lastMouseY = mouseY ;
386390
387391 // Draw button tooltips
388392 Optional <ITerminalStorageTabClient <?>> tabOptional = getSelectedClientTab ();
@@ -428,6 +432,14 @@ protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
428432 }
429433 }
430434
435+ @ Override
436+ protected void renderSlots (GuiGraphics guiGraphics ) {
437+ super .renderSlots (guiGraphics );
438+
439+ // Postpone this until after all slots are rendered, to ensure it is rendered in front of other slots.
440+ drawActiveStorageSlotItem (guiGraphics , this .lastMouseX , this .lastMouseY );
441+ }
442+
431443 @ Override
432444 protected void drawCurrentScreen (GuiGraphics guiGraphics , int mouseX , int mouseY , float partialTicks ) {
433445 scrollBar .render (guiGraphics , mouseX , mouseY , partialTicks );
0 commit comments