Made bookmark buttons only open when the page isn't already open

This commit is contained in:
Ellpeck 2016-11-12 16:17:11 +01:00
parent ecafafe57e
commit 6648fb29e2

View file

@ -45,7 +45,7 @@ public class BookmarkButton extends GuiButton{
if(GuiScreen.isShiftKeyDown()){ if(GuiScreen.isShiftKeyDown()){
this.assignedPage = null; this.assignedPage = null;
} }
else{ else if(!(this.booklet instanceof GuiPage) || ((GuiPage)this.booklet).pages[0] != this.assignedPage){
GuiPage gui = BookletUtils.createPageGui(this.booklet.previousScreen, this.booklet, this.assignedPage); GuiPage gui = BookletUtils.createPageGui(this.booklet.previousScreen, this.booklet, this.assignedPage);
Minecraft.getMinecraft().displayGuiScreen(gui); Minecraft.getMinecraft().displayGuiScreen(gui);
} }