diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-01-13 22:18:08 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-01-13 22:18:08 +0000 |
commit | 055a4a7a816914c937f683d7049073d2cb1e1351 (patch) | |
tree | b9fd46b6c36f600c3e96ffec24838c2301d0bbe0 | |
parent | e9c32c790c4bc97f3e106197b90e864b1284385b (diff) | |
download | Essentials-055a4a7a816914c937f683d7049073d2cb1e1351.tar Essentials-055a4a7a816914c937f683d7049073d2cb1e1351.tar.gz Essentials-055a4a7a816914c937f683d7049073d2cb1e1351.tar.lz Essentials-055a4a7a816914c937f683d7049073d2cb1e1351.tar.xz Essentials-055a4a7a816914c937f683d7049073d2cb1e1351.zip |
Cleanup of book meta.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/textreader/BookInput.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/textreader/BookPager.java | 16 |
2 files changed, 3 insertions, 15 deletions
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<String> lines = text.getLines(); List<String> chapters = text.getChapters(); + List<String> pageLines = new ArrayList<String>(); Map<String, Integer> 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<String> pageLines = new ArrayList<String>(); - 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<String> pages = new ArrayList<String>(); - 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; - } } |