@@ -247,6 +247,8 @@ private static int sizeStringToWidth(String par1Str, int par2)
247
247
/**
248
248
* Inserts splitchar into a string to wrap it within the specified width.
249
249
*/
250
+ // TODO: Why does this insert SPLIT_CHAR instead of returning an array of line start positions or an array of
251
+ // line strings? Maybe it's worth doing something like the new vanilla code?
250
252
private static String wrapFormattedStringToWidth (String strIn , int maxWidth ){
251
253
int maxCharsInWidth = sizeStringToWidth (strIn , maxWidth );
252
254
@@ -266,17 +268,9 @@ private static String wrapFormattedStringToWidth(String strIn, int maxWidth){
266
268
}
267
269
268
270
269
-
270
-
271
-
272
-
273
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
274
-
275
-
276
-
277
271
/**
278
272
* Removes trailing newline characters then splits the string into a list
279
- * of 116 pixel wide strings (since that's the width of a book).
273
+ * of book width strings
280
274
* Note: this won't split it up into pages. If you want to do that too,
281
275
* you should use stringToPages()
282
276
* Note 2: this preserves trailing whitespace (unlike FontRenderer.listFormattedStringToWidth())
@@ -301,7 +295,7 @@ public static List<String> splitStringIntoLines(String str){
301
295
* Splits a monolithic string into a list of strings, each representing one book page.
302
296
*
303
297
* Note that while the single player version will allow an almost unlimited number of characters
304
- * on the same line , Spigot, (and likely the vanilla server) will only allow 256. This, combined with extra format
298
+ * on the same page , Spigot, (and likely the vanilla server) will only allow 256. This, combined with extra format
305
299
* characters being inserted was causing pages to be split in new and strange places
306
300
*/
307
301
public static List <String > stringToPages (String str ){
@@ -348,7 +342,7 @@ else if (charCount == 256){
348
342
349
343
/**
350
344
* Splits a monolithic string into a list of strings, each representing one
351
- * book page. New pages are started after 13 lines, 256 character , or the page break symbol (whichever is first)
345
+ * book page. New pages are started after 13 lines, 256 characters , or the page break symbol (whichever is first)
352
346
* @param str Input string
353
347
* @param pageBreakString The symbol that denotes a page break (this will be removed during conversion)
354
348
* @return ArrayList of Strings representing pages
0 commit comments