Skip to content

Commit

Permalink
Merge branch '1.21.0' of D:\Repos\Minecraft\SFM\repos\SuperFactoryMan…
Browse files Browse the repository at this point in the history
…ager 1.21.0 into 1.21.1
  • Loading branch information
TeamDman committed Aug 26, 2024
2 parents df23478 + bb6f889 commit 77eec97
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 77eec97

Please sign in to comment.