From f86893ec1481a1beac3b487a5a3d2ba0f7d25c93 Mon Sep 17 00:00:00 2001 From: KnightMiner Date: Mon, 9 Dec 2024 20:09:29 -0500 Subject: [PATCH] Fix missing page numbers on books Broke early 1.18 during some book fixes --- .../mantle/client/screen/book/BookScreen.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java b/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java index 73568eaa..bf11babe 100644 --- a/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java +++ b/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java @@ -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();