diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java index fe6ff9f40..2afd2fe8e 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java @@ -375,6 +375,9 @@ public class GuiBooklet extends GuiScreen{ if(this.currentPage != null){ BookletPage page = this.getNextPage(this.currentChapter, this.currentPage); if(page != null) this.currentPage = page; + + this.getButton(BUTTON_FORWARD_ID).visible = this.getNextPage(this.currentChapter, this.currentPage) != null; + this.getButton(BUTTON_BACK_ID).visible = this.getPrevPage(this.currentChapter, this.currentPage) != null; } else{ this.openIndexEntry(this.currentIndexEntry, this.pageOpenInIndex+1, !(this.currentIndexEntry instanceof BookletEntryAllSearch)); @@ -386,6 +389,9 @@ public class GuiBooklet extends GuiScreen{ if(this.currentPage != null){ BookletPage page = this.getPrevPage(this.currentChapter, this.currentPage); if(page != null) this.currentPage = page; + + this.getButton(BUTTON_FORWARD_ID).visible = this.getNextPage(this.currentChapter, this.currentPage) != null; + this.getButton(BUTTON_BACK_ID).visible = this.getPrevPage(this.currentChapter, this.currentPage) != null; } else{ this.openIndexEntry(this.currentIndexEntry, this.pageOpenInIndex-1, !(this.currentIndexEntry instanceof BookletEntryAllSearch)); @@ -416,15 +422,6 @@ public class GuiBooklet extends GuiScreen{ } } } - - if(button.id == BUTTON_FORWARD_ID || button.id == BUTTON_BACK_ID){ - if(this.currentChapter != null && this.currentIndexEntry != null){ - if(this.currentPage != null){ - this.getButton(BUTTON_FORWARD_ID).visible = this.getNextPage(this.currentChapter, this.currentPage) != null; - this.getButton(BUTTON_BACK_ID).visible = this.getPrevPage(this.currentChapter, this.currentPage) != null; - } - } - } } @SuppressWarnings("unchecked")