waffle-stomper / Ghostwriter

Ghostwriter - A Book Work Mod for Minecraft
GNU General Public License v3.0
35 stars 6 forks source link

Ghostwriter can produce 'impossible' pages with more than 13 lines #27

Closed waffle-stomper closed 3 years ago

waffle-stomper commented 3 years ago

This works on Spigot 1.16.1 but I'm not sure about the vanilla server.

Steps to reproduce:

  1. Save the example text below into a .ghb file
  2. Load it in Ghostwriter and paste it into a new book
  3. Note that the page is 15 lines long in the unsigned book
  4. Sign the book
  5. Note that it's still 14 lines long. The 15th line still seems to be present, but it's not displayed.

Example text:

and exclaiming in ##
wonder at such a ##
pretty animal, he went ##
to stroke her. Poor Io! ##
She could not tell him ##
who she was, but she ##
thrust her soft muzzle ##
into his head, and tried ##
to speak to him with ##
her great eyes.##
  Then suddenly she ##
thought she would##
waffle-stomper commented 3 years ago

Fixing this will once again create extra pages with small amounts of text when splitting an oversized page. Perhaps we can warn the user and give them the option to just ignore all page breaks? This may not be necessary if #30 is implemented though.

waffle-stomper commented 3 years ago

Commit 2265462b64d90a8fa332e082d45fbbcd8a807f06 adds a warning about too many lines on a page

waffle-stomper commented 3 years ago

Fixed by 8e279d1b19c835b122f64d0be386fba885845844

Loaded book pages are now capped at 14 lines (the most the 1.16.1 client will render in a signed book)