diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java index 8d07776f1..4fd728ed9 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java @@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.booklet.InitBooklet; import ellpeck.actuallyadditions.booklet.chapter.BookletChapter; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; +import ellpeck.actuallyadditions.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiScreen; @@ -36,13 +37,13 @@ import java.util.Map; public class BookletPage{ public boolean arePageStacksWildcard; - protected int id; + protected int localizationKey; protected BookletChapter chapter; private HashMap textReplacements = new HashMap(); private boolean hasNoText; - public BookletPage(int id){ - this.id = id; + public BookletPage(int localizationKey){ + this.localizationKey = localizationKey; } @SideOnly(Side.CLIENT) @@ -95,7 +96,7 @@ public class BookletPage{ } public int getID(){ - return this.id; + return Util.arrayContains(this.chapter.pages, this)+1; } public final String getText(){ @@ -103,7 +104,7 @@ public class BookletPage{ return null; } - String base = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.id).replaceAll("", EnumChatFormatting.DARK_GREEN+"").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+"").replaceAll("", "\n").replaceAll("", EnumChatFormatting.ITALIC+"").replaceAll("", EnumChatFormatting.RESET+""); + String base = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.localizationKey).replaceAll("", EnumChatFormatting.DARK_GREEN+"").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+"").replaceAll("", "\n").replaceAll("", EnumChatFormatting.ITALIC+"").replaceAll("", EnumChatFormatting.RESET+""); for(Object o : this.textReplacements.entrySet()){ Map.Entry e = (Map.Entry)o; base = base.replaceAll((String)e.getKey(), (String)e.getValue());