diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEConfigSlotWidget.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEConfigSlotWidget.java index 25066b3d5f..71c10c62e2 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEConfigSlotWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEConfigSlotWidget.java @@ -49,21 +49,34 @@ public AEConfigSlotWidget(Position pos, Size size, ConfigWidget widget, int inde public void drawInForeground(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { super.drawInForeground(graphics, mouseX, mouseY, partialTicks); IConfigurableSlot slot = this.parentWidget.getDisplay(this.index); - if (slot.getConfig() == null && mouseOverConfig(mouseX, mouseY)) { - List hoverStringList = new ArrayList<>(); - hoverStringList.add(Component.translatable("gtceu.gui.config_slot")); - if (parentWidget.isAutoPull()) { - hoverStringList.add(Component.translatable("gtceu.gui.config_slot.auto_pull_managed")); - } else { - if (!parentWidget.isStocking()) { - hoverStringList.add(Component.translatable("gtceu.gui.config_slot.set")); - hoverStringList.add(Component.translatable("gtceu.gui.config_slot.scroll")); + if (slot.getConfig() == null) { + if (mouseOverConfig(mouseX, mouseY)) { + List hoverStringList = new ArrayList<>(); + hoverStringList.add(Component.translatable("gtceu.gui.config_slot")); + if (parentWidget.isAutoPull()) { + hoverStringList.add(Component.translatable("gtceu.gui.config_slot.auto_pull_managed")); } else { - hoverStringList.add(Component.translatable("gtceu.gui.config_slot.set_only")); + if (!parentWidget.isStocking()) { + hoverStringList.add(Component.translatable("gtceu.gui.config_slot.set")); + hoverStringList.add(Component.translatable("gtceu.gui.config_slot.scroll")); + } else { + hoverStringList.add(Component.translatable("gtceu.gui.config_slot.set_only")); + } + hoverStringList.add(Component.translatable("gtceu.gui.config_slot.remove")); } - hoverStringList.add(Component.translatable("gtceu.gui.config_slot.remove")); + graphics.renderTooltip(Minecraft.getInstance().font, hoverStringList, Optional.empty(), mouseX, mouseY); + } + } else { + GenericStack item = null; + if (mouseOverConfig(mouseX, mouseY)) { + item = slot.getConfig(); + } else if (mouseOverStock(mouseX, mouseY)) { + item = slot.getStock(); + } + if (item != null) { + graphics.renderTooltip(Minecraft.getInstance().font, GenericStack.wrapInItemStack(item), mouseX, + mouseY); } - graphics.renderTooltip(Minecraft.getInstance().font, hoverStringList, Optional.empty(), mouseX, mouseY); } } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEItemConfigSlotWidget.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEItemConfigSlotWidget.java index f9ed18b26d..ab122dbfb5 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEItemConfigSlotWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/slot/AEItemConfigSlotWidget.java @@ -10,7 +10,6 @@ import com.lowdragmc.lowdraglib.utils.Position; import com.lowdragmc.lowdraglib.utils.Size; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.Rect2i; import net.minecraft.network.FriendlyByteBuf; @@ -88,22 +87,6 @@ private void drawSlots(GuiGraphics graphics, int mouseX, int mouseY, int x, int GuiTextures.SLOT_DARK.draw(graphics, mouseX, mouseY, x, y + 18, 18, 18); } - @OnlyIn(Dist.CLIENT) - @Override - public void drawInForeground(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { - super.drawInForeground(graphics, mouseX, mouseY, partialTicks); - GenericStack item = null; - IConfigurableSlot slot = this.parentWidget.getDisplay(this.index); - if (mouseOverConfig(mouseX, mouseY)) { - item = slot.getConfig(); - } else if (mouseOverStock(mouseX, mouseY)) { - item = slot.getStock(); - } - if (item != null) { - graphics.renderTooltip(Minecraft.getInstance().font, GenericStack.wrapInItemStack(item), mouseX, mouseY); - } - } - @OnlyIn(Dist.CLIENT) @Override public boolean mouseClicked(double mouseX, double mouseY, int button) {