diff --git a/Essentials/src/com/earth2me/essentials/textreader/BookInput.java b/Essentials/src/com/earth2me/essentials/textreader/BookInput.java index 26ee1dad5..d8df79ec2 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/BookInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/BookInput.java @@ -17,7 +17,7 @@ public class BookInput implements IText public BookInput(final String filename, final boolean createFile, final IEssentials ess) throws IOException { - File file = null; + File file = null; if (file == null || !file.exists()) { file = new File(ess.getDataFolder(), filename + ".txt"); diff --git a/Essentials/src/com/earth2me/essentials/textreader/BookPager.java b/Essentials/src/com/earth2me/essentials/textreader/BookPager.java index 0cd2c630e..1a2d80e9e 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/BookPager.java +++ b/Essentials/src/com/earth2me/essentials/textreader/BookPager.java @@ -1,12 +1,9 @@ package com.earth2me.essentials.textreader; -import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.Util; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.logging.Logger; public class BookPager @@ -22,10 +19,9 @@ public class BookPager { List lines = text.getLines(); List chapters = text.getChapters(); + List pageLines = new ArrayList(); Map bookmarks = text.getBookmarks(); - int chapterpage = 0; - //This checks to see if we have the chapter in the index if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH))) { @@ -44,8 +40,6 @@ public class BookPager } } - List pageLines = new ArrayList(); - for (int lineNo = chapterstart; lineNo < chapterend; lineNo += 1) { String pageLine = "\u00a70" + lines.get(lineNo); @@ -72,7 +66,7 @@ public class BookPager if (letter == '\u00a7') { Character nextLetter = pageLine.charAt(pointer + 1); - if (nextLetter == 'l') + if (nextLetter == 'l' || nextLetter == 'L') { weight = 1.25; } @@ -100,23 +94,17 @@ public class BookPager } List pages = new ArrayList(); - for (int count = 0; count < pageLines.size(); count += 12) { - StringBuilder newPage = new StringBuilder(); - for (int i = count; i < count + 12 && i < pageLines.size(); i++) { newPage.append("\n").append(pageLines.get(i)); - //Logger.getLogger("Minecraft").info("adding line " + pageLines.get(i) + " to book"); } - //Logger.getLogger("Minecraft").info("adding page to book"); pages.add(newPage.toString()); } return pages; - } }