Skip to content

Commit

Permalink
Merge branch '1.20.4' of D:\Repos\Minecraft\SFM\repos\SuperFactoryMan…
Browse files Browse the repository at this point in the history
…ager 1.20.4 into 1.21.0
  • Loading branch information
TeamDman committed Aug 26, 2024
2 parents a0793a0 + 6b40932 commit bb6f889
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/main/java/ca/teamdman/sfm/client/gui/screen/ManagerScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.client.gui.screens.ConfirmScreen;
import net.minecraft.client.gui.screens.Screen;
Expand Down Expand Up @@ -504,11 +505,26 @@ public void render(GuiGraphics graphics, int mx, int my, float partialTicks) {
}

@Override
protected void renderTooltip(GuiGraphics pGuiGraphics, int pX, int pY) {
if (Minecraft.getInstance().screen != this) return;
protected void renderTooltip(
GuiGraphics pGuiGraphics,
int pX,
int pY
) {
if (Minecraft.getInstance().screen != this) {
// this should fix the annoying Ctrl+E popup when editing
this.renderables
.stream()
.filter(AbstractWidget.class::isInstance)
.map(AbstractWidget.class::cast)
.forEach(w -> w.setFocused(false));
return;
}

// render hovered item
super.renderTooltip(pGuiGraphics, pX, pY);
}


@Override
protected void renderBg(
GuiGraphics graphics,
Expand Down

0 comments on commit bb6f889

Please sign in to comment.