Tooltips will no longer go off the screen while looking at them in the book.
@@ -12,6 +12,7 @@ import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.gui.GuiUtils;
import slimeknights.mantle.client.render.RenderingHelper;
+import slimeknights.mantle.client.screen.book.BookScreen;
import slimeknights.mantle.client.screen.book.element.ItemElement;
import javax.annotation.Nullable;
@@ -70,4 +71,11 @@ public class TinkerItemElement extends ItemElement {
super.drawOverlay(matrixStack, mouseX, mouseY, partialTicks, fontRenderer);
}
+
+ //Fix odd tooltip rendering that makes the tooltip go off the screen.
+ @Override
+ public void drawHoveringText(MatrixStack matrixStack, List<ITextComponent> textLines, int x, int y, FontRenderer font) {
+ GuiUtils.drawHoveringText(matrixStack, textLines, x, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT, BookScreen.PAGE_WIDTH, font);
+ RenderHelper.disableStandardItemLighting();
+ }
}
