Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Crash when opening book with empty chapters/sections #80

Open
ElectroBot opened this issue Nov 2, 2018 · 3 comments
Open

[Bug] Crash when opening book with empty chapters/sections #80

ElectroBot opened this issue Nov 2, 2018 · 3 comments

Comments

@ElectroBot
Copy link

The book below (with and without the empty sections) crashes the game. I was trying to find out how to have empty pages (realized later the sections are the pages).

<book title="Test book" cover="gbook:topsecret" fontSize="0.6" home="1:2"> <chapter> <section> </section> </chapter> </book>

Minecraft: 1.12.2
Forge: 14.23.5.2772
Guidebook: 1.12.2-2.8.3

Crash report: https://paste.dimdev.org/apusogiwor.rb

@QbDesu
Copy link
Contributor

QbDesu commented Nov 17, 2018

Yes this is an issue with empty chapters.

final VisualPage pgLeft = ch.pages.get(currentPair * 2);

The line above throws an IndexOutOfBoundsException.
A possible way to fix this would be applying the same checks that are applied to the right-hand page for the left-hand page as well. Alternatively empty chapters could be removed and maybe a book without a chapter would not be able to open or automatically appear blank.

@ElectroBot
Copy link
Author

There are uses for empty pages though (aesthetic). Not sure if applying the checks or maybe adding a tag for an blank page would doable.

@gigaherz
Copy link
Owner

gigaherz commented Nov 17, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants