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

Add a config value for page string max length #11

Open
Mumberthrax opened this issue Jan 2, 2022 · 1 comment
Open

Add a config value for page string max length #11

Mumberthrax opened this issue Jan 2, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Mumberthrax
Copy link

Mumberthrax commented Jan 2, 2022

Is your feature request related to a problem? Please describe.
Same issue as #9 except I believe I discovered it may only be string length and not byte amount being restricted. The new textbook update (2.2.0) with the byte restriction feature is extremely useful and works for most of my use cases - and I believe I was mistaken in identifying bytes as the issue instead of simple string length.

Describe the solution you'd like
in MinecraftBookConstraints.java, fitsOnPage() should check for a config value to compare string length to, instead of or in addition to the current comparison of 1024.

Additional context
I installed the Stendhal mod by NebSpacefarer which shows character count in the in-game gui for each page. I was experimenting with the byte restriction feature of Textbook 2.2.0 to figure out what limit was set on a default paperMC server, and realized that none of the pages were exceeding 320 characters. I set the textbook byte restriction to 833 which seemed to work with a text i was using, and then tried importing a different one - an ascii art - that had been severely affected by the papermc restrictions previously. Even though textbook was importing it without the byte restrictions affecting it, it had around 400 characters. Closing the gui it was edited by the server down to 320 characters.

the ascii art page
image

After papermc updates the page:
image

edit: A modified version of the ascii art which is not edited by the server, in case it is useful

My current test text with plaintext characters

The same test text with fullwidth characters

This proposed change is not essential for my purposes personally, but might be nice-to-have since it addresses the paperMC restrictions seemingly more directly. Sorry for my mistake on the matter before.

@Mumberthrax Mumberthrax added the enhancement New feature or request label Jan 2, 2022
@The-Fireplace
Copy link
Member

I don't believe your previous issue was a mistake, just a separate restriction that Paper has. I can see about making the max characters per page configurable at some point.

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

No branches or pull requests

2 participants