Jump to content

Recommended Posts

Posted

I'm thinking of creating a library type modpack but the text limit in books is far too small, Is there any way to increase the text and chapter limit? (I'm unsure if this would be the proper place to add. I know java and how to create mods just not this specific type.)

Posted

I don't know if you can change the vanilla behavior, never thought about this. However one quick way I can think of is to create your own custom book item that defines how many pages or character per page to have, and of course create the GUI accordingly

Don't blame me if i always ask for your help. I just want to learn to be better :)

Posted

The limits used by books come from the limits of NBT (used for networking and storing to file) which in turn come from legacy limits imposed by java serialization.

If you look at java's DataOutput.writeUTF() it says the maximum size is 65535 characters. Minecraft actually uses 1/2 that, 32767, presumably in case all characters are double byte?

 

If you want to increase the limits you would need to change how the page's text gets stored in NBT. e.g. using a List of Strings instead of a single String for each page.

That would change the serialization format.

For the vanilla books, that's not something Forge would do. Because Forge supports being a "vanilla" server for vanilla clients. Changing the serialization format would break the vanilla clients.

Changing other fields like the number of pages or title length would also likely break the expectations of the vanilla guis.

 

So basically if you want to do this, you would need to create your own book items and probably your own custom blocks like the Lectern and Bookshelves to support them.

The problem with doing that is that things like the (Enchanted)BookItem are hardcoded by Mojang into the enchanting code. And not just the class, the actual object instances.

There are probably other hardcodings?

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.