Skip to content

Commit

Permalink
Fix missing page numbers on books
Browse files Browse the repository at this point in the history
Broke early 1.18 during some book fixes
  • Loading branch information
KnightMiner committed Dec 10, 2024
1 parent 44aff66 commit f86893e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,19 @@ public void render(PoseStack matrixStack, int mouseX ,int mouseY, float partialT
renderPageBackground(matrixStack, true);
}

// add page numbers at bottom
if (this.book.appearance.drawPageNumbers) {
if (renderLeft) {
String pNum = this.page * 2 + "";
fontRenderer.draw(leftMatrix, pNum, (PAGE_WIDTH - fontRenderer.width(pNum)) / 2f, PAGE_HEIGHT - 10, 0xFFAAAAAA);
}
if (renderRight) {
String pNum = this.page * 2 + 1 + "";
fontRenderer.draw(rightMatrix, pNum, (PAGE_WIDTH - fontRenderer.width(pNum)) / 2f, PAGE_HEIGHT - 10, 0xFFAAAAAA);
}

}

int leftMX = this.getMouseX(false);
int rightMX = this.getMouseX(true);
int mY = this.getMouseY();
Expand Down

0 comments on commit f86893e

Please sign in to comment.