Hax to fix fluid tooltip rendering for forestry & ticon

This commit is contained in:
Jason Mitchell authored and Jason Mitchell committed 2021-04-12 20:20:36 -07:00
1 parent 5bfbf250cc
commit 0e3507de0a
2 files changed
+16 -2

No files matched your search

+1 -1
View File
@@ -2,4 +2,4 @@ mc_version=1.7.10
forge_version=10.13.4.1614-1.7.10
ccl_version=1.1.3.138
ccc_version=1.0.7.+
mod_version=2.1.0-GTNH-beta10
mod_version=2.1.0-GTNH-beta11
+15 -1
View File
@@ -242,9 +242,23 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
final int recipesPerPage = getRecipesPerPage();
for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++)
/*
* Several mods try to figure out the relative mouse position for fluid tooltips. This worked fine
* when it was a static 166.. however now that we're scaling it this no longer works. Rather than
* patching the individual mods (so that we can be as compatible as possible), we'll just fake
* the height for their tooltip rendering.
*/
// Begin Hax
final int oldHeight = this.height;
this.height = 166 + handlerInfo.getHeight() + 18 + (guiTop - 44) * 2;
for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) {
currenttip = handler.handleTooltip(this, currenttip, i);
}
recipeTabs.handleTooltip(mousex, mousey, currenttip);
this.height = oldHeight;
// End Hax
return currenttip;
}