Skip to content

Commit

Permalink
Fix NEI tooltip not being drawn (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Sep 10, 2024
1 parent c2a2b6e commit eb56991
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerDrawHandler;
import codechicken.nei.guihook.IContainerInputHandler;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

Expand Down Expand Up @@ -148,7 +147,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
drawHandler.postRenderObjects(this, mouseX, mouseY);
}

if (!shouldRenderOurTooltip() && shouldRenderNEITooltip() && GuiContainerManager.getManager() != null) {
if (!shouldRenderOurTooltip() && GuiContainerManager.getManager() != null) {
GuiContainerManager.getManager().renderToolTips(mouseX, mouseY);
}
}
Expand Down Expand Up @@ -333,17 +332,6 @@ protected boolean shouldRenderOurTooltip() {
return context.getCursor().getHovered() != null;
}

protected boolean shouldRenderNEITooltip() {
// taken from GuiContainerManager#getStackMouseOver but don't check #getSlotMouseOver
// as it sees our slot even if it's disabled
for (IContainerObjectHandler objectHandler : GuiContainerManager.objectHandlers) {
ItemStack item = objectHandler
.getStackUnderMouse(this, context.getCursor().getPos().x, context.getCursor().getPos().y);
if (item != null) return true;
}
return false;
}

public void drawDebugScreen() {
Size screenSize = context.getScaledScreenSize();
int neiYOffset = shouldShowNEI() ? 20 : 0;
Expand Down

0 comments on commit eb56991

Please sign in to comment.