Fixed last page not always rendering

This commit is contained in:
Arthur Uzulin committed 2019-03-23 01:55:06 +11:00
1 parent 27a25c1be4
commit 840408446d
1 file changed
+1 -1
@@ -263,7 +263,7 @@ public class GuiBook extends GuiScreen {
RenderHelper.disableStandardItemLighting();
int fullPageCount = book.getFullPageCount(advancementCache);
if((page < fullPageCount - 1 || fullPageCount % 2 != 0) && page < fullPageCount) {
if(page < fullPageCount - 1 || book.getPageCount(advancementCache) % 2 != 0) {
drawModalRectWithCustomSizedTexture(width / 2, height / 2 - PAGE_HEIGHT_UNSCALED / 2, PAGE_WIDTH_UNSCALED, PAGE_HEIGHT_UNSCALED, PAGE_WIDTH_UNSCALED, PAGE_HEIGHT_UNSCALED, TEX_SIZE, TEX_SIZE);
GlStateManager.pushMatrix();