If I can suggest anything, it's to make the smart paster have dynamic limits (e.g. so the user can configure whether it behaves the default way, or only pastes as much text as a legit MC book can contain, or even, say, only has 5 lines of text per page).
In addition, there should be an export feature, which exports text files from the book, and also allows the user to specify a 'page delimiter' (the default could be Microsoft Word's pagebreak, if that's just a normal Unicode character).
Just use the [Save .mcbook] button in the File menu. However, it just uses "\nPage∆" as the page separator, nothing configurable. I'll work on that after some of the other updates you mentioned.
I actually wrote an AutoHotKey script that can paste a book into Minecraft, on the condition that the text you're pasting has "§p" anywhere you want a pagebreak. It's not a "smart" paste or anything; it can only paste pages which are short enough for Minecraft to naturally allow you to paste. But it's still very useful to me as I'm making a library in SMP and don't have admin rights on it. But anyways, since I plan to eventually release that AHK script, the features I suggested above may let people use both our works in conjunction for making books easily on servers
Quite a good idea, I had never thought of the like before. I'll see what I can do with the .mcbook file.
P.S. The "smart" paster isn't really that smart, it just checks the length of the current page before adding the next word.
P.S.S. Nice use of a semicolon. You don't see them very often now.
Also, how do you actually get the Smart Paster to paste? I open it up, and it already has stuff in there which I recently copied, but no GUI buttons or an indicator that anything's happening.
That, my friend, was a bug in the recent update. It's fixed now.
Oh, just letting you know, I made a program that can split text into pages which are guaranteed to fit in a Minecraft book even when pasted in vanilla (attempting to fit as much text as possible on a page, without cutting words in half). It even lets you choose custom delimiters. However, the only way I could guarantee it always would work for Minecraft is to actually take code from Minecraft - namely, some of the FontRenderer class, and the entirety of the ChatAllowedCharacters class.
The method determining whether a player can paste text in a book calls a FontRenderer method, splitStringHeight (it seems someone on the mcp team misunderstood the method's purpose and called it "splitStringWidth"; I renamed it in my version because it's definitely measuring height, not width). This method in turn relies on getStringWidth and getCharWidth, along with a portion of the constructor which sets up the arrays defining character width. getCharWidth also uses the ChatAllowedCharacters class in determining which array to use (the default font and Unicode font have separate width arrays).
My program also relies on the files font.txt, font/default.png, and font/glyph_sizes.bin. I suppose all of this means I can't share my program legally, right? It's a shame, because any rewrite of the code guaranteed to work identically to Minecraft's would also look sufficiently similar. The only way to legally provide a pagesplitter like this is to actually make it as a mod, right?
If not, I'll gladly hand you my code, to help improve Revise
Oh, just letting you know, I made a program that can split text into pages which are guaranteed to fit in a Minecraft book even when pasted in vanilla (attempting to fit as much text as possible on a page, without cutting words in half). It even lets you choose custom delimiters. However, the only way I could guarantee it always would work for Minecraft is to actually take code from Minecraft - namely, some of the FontRenderer class, and the entirety of the ChatAllowedCharacters class.
The method determining whether a player can paste text in a book calls a FontRenderer method, splitStringHeight (it seems someone on the mcp team misunderstood the method's purpose and called it "splitStringWidth"; I renamed it in my version because it's definitely measuring height, not width). This method in turn relies on getStringWidth and getCharWidth, along with a portion of the constructor which sets up the arrays defining character width. getCharWidth also uses the ChatAllowedCharacters class in determining which array to use (the default font and Unicode font have separate width arrays).
I don't know why I never looked in the Minecraft classes for how to measure a Minecraft font... I just used Java's FontMetrics class, but your way makes much more sense.
My program also relies on the files font.txt, font/default.png, and font/glyph_sizes.bin. I suppose all of this means I can't share my program legally, right? It's a shame, because any rewrite of the code guaranteed to work identically to Minecraft's would also look sufficiently similar. The only way to legally provide a pagesplitter like this is to actually make it as a mod, right?
If not, I'll gladly hand you my code, to help improve Revise
I just looked on minecraft.net and look what I found.
"Basically, mods (or plugins, or tools) are cool (you can distribute those)...Any tools you write for the game from scratch belongs to you."
It's under the Terms of Use in the What You Can Do section. Not sure how to interpret it, though, because by using a little bit of Minecraft's code means it's not from scratch, but mods all do this and are included in the category... So... What do you think?
I just looked on minecraft.net and look what I found.
"Basically, mods (or plugins, or tools) are cool (you can distribute those)...Any tools you write for the game from scratch belongs to you."
It's under the Terms of Use in the What You Can Do section. Not sure how to interpret it, though, because by using a little bit of Minecraft's code means it's not from scratch, but mods all do this and are included in the category... So... What do you think?
Well, maybe I should ask an administrator? I know all mods have to overwrite some Minecraft class or another, and thus have to distribute a copy of it, so you may be right. But I suppose it also depends on how much was from the game and how much was from scratch.
I'm using 1.3 pre-release version, and everytime I use the button to export the file, it doesn't appear in my inventory. I tried it in other worlds too, but nothing happens... Neither the save button works properly... I hope you can help me! Thank you in anticipation
Sorry about that, they must've changed something about where things are saved. I'll start working on that right now.
For the love of God I cannot get this to work in my single player, I export the book however it still loads my old book when I begin the world
Ya, sorry about that. As I said above, I'm working on that presently. Something changed with the new version of Minecraft that broke that and I'm looking for what did. Sorry for the inconvenience.
Sorry for the wait, but I've found the problem. It's not a big one, but it'll require a lot of typing. I'll try to get it out within the next couple of days. Thank you for you patience.
Seems nice. But once in go in ''LOAD BOOK'' there are no books. If I click ''OPEN'', it does nothing. Probably something I'm missing or one of the various problems.
This tool is FAR too fantastic to not be more WYSIWYG... Changing the color of the text should actually change the color instead of showing the control characters, bold should be bold, etc. Of course control characters still need to be taken into account behind the scenes as far as line length etc is concerned, but I'd love to see the book exactly as it will appear in-game.
Thanks a TON for your efforts! This is a great time-saver!
Seems nice. But once in go in ''LOAD BOOK'' there are no books. If I click ''OPEN'', it does nothing. Probably something I'm missing or one of the various problems.
Any other details, because I cannot seem to recreate the problem. It may be that you do not have a book already in your inventory.
Edit: Fixed now, the loading of single-player files was a bit buggy if you selected the level.dat
Do you have a .exe download? I can't get it to run for some reason.
Sorry, but I develop on a Mac, so no .exe's. I'll try to get one working on my Windows machine, but it may take a bit. Also, could you check the Task Manager to see if it is actually launching and just not displaying?
Changing the color of the text should actually change the color instead of showing the control characters, bold should be bold, etc. Of course control characters still need to be taken into account behind the scenes as far as line length etc is concerned, but I'd love to see the book exactly as it will appear in-game.
Ya, I've been thinking about that for a bit, I just haven't put it in yet. I'll go ahead and officially add it to my To-Do list.
Just released a quick fix, 1.0.4. This clears up the problem of saving and loading books from single-player worlds. I'll fix the exporting of books within a few hours. Thank you for your patience.
Ok, everything is functioning properly again, or at least as far as I can tell. I did quite a bit of testing, and everything seems to work properly again, so enjoy. Thanks for waiting.
You, sir, are an absolute genius.
Just use the [Save .mcbook] button in the File menu. However, it just uses "\nPage∆" as the page separator, nothing configurable. I'll work on that after some of the other updates you mentioned.
Quite a good idea, I had never thought of the like before. I'll see what I can do with the .mcbook file.
P.S. The "smart" paster isn't really that smart, it just checks the length of the current page before adding the next word.
P.S.S. Nice use of a semicolon. You don't see them very often now.
That, my friend, was a bug in the recent update. It's fixed now.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
The method determining whether a player can paste text in a book calls a FontRenderer method, splitStringHeight (it seems someone on the mcp team misunderstood the method's purpose and called it "splitStringWidth"; I renamed it in my version because it's definitely measuring height, not width). This method in turn relies on getStringWidth and getCharWidth, along with a portion of the constructor which sets up the arrays defining character width. getCharWidth also uses the ChatAllowedCharacters class in determining which array to use (the default font and Unicode font have separate width arrays).
My program also relies on the files font.txt, font/default.png, and font/glyph_sizes.bin. I suppose all of this means I can't share my program legally, right? It's a shame, because any rewrite of the code guaranteed to work identically to Minecraft's would also look sufficiently similar. The only way to legally provide a pagesplitter like this is to actually make it as a mod, right?
If not, I'll gladly hand you my code, to help improve Revise
thanks to LucasAntunes998 for making this banner!
I don't know why I never looked in the Minecraft classes for how to measure a Minecraft font... I just used Java's FontMetrics class, but your way makes much more sense.
I just looked on minecraft.net and look what I found.
"Basically, mods (or plugins, or tools) are cool (you can distribute those)...Any tools you write for the game from scratch belongs to you."
It's under the Terms of Use in the What You Can Do section. Not sure how to interpret it, though, because by using a little bit of Minecraft's code means it's not from scratch, but mods all do this and are included in the category... So... What do you think?
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Well, maybe I should ask an administrator? I know all mods have to overwrite some Minecraft class or another, and thus have to distribute a copy of it, so you may be right. But I suppose it also depends on how much was from the game and how much was from scratch.
Ya, that's probably the safest action.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Sorry about that, they must've changed something about where things are saved. I'll start working on that right now.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Ya, sorry about that. As I said above, I'm working on that presently. Something changed with the new version of Minecraft that broke that and I'm looking for what did. Sorry for the inconvenience.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
As you wish, sire.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
This tool is FAR too fantastic to not be more WYSIWYG... Changing the color of the text should actually change the color instead of showing the control characters, bold should be bold, etc. Of course control characters still need to be taken into account behind the scenes as far as line length etc is concerned, but I'd love to see the book exactly as it will appear in-game.
Thanks a TON for your efforts! This is a great time-saver!
Any other details, because I cannot seem to recreate the problem. It may be that you do not have a book already in your inventory.
Edit: Fixed now, the loading of single-player files was a bit buggy if you selected the level.dat
Sorry, but I develop on a Mac, so no .exe's. I'll try to get one working on my Windows machine, but it may take a bit. Also, could you check the Task Manager to see if it is actually launching and just not displaying?
Ya, I've been thinking about that for a bit, I just haven't put it in yet. I'll go ahead and officially add it to my To-Do list.
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net
Lost Realms Server
Apply: http://lostrealms.net/apply.php
IP: play.lostrealms.net