Fixed:
- Writable and written books that contained illegal unicode that SnakeYAML (inside Spigot/Bukkit) could not save caused an big error. This fixes it by saving to a new Test-File.yml and checks if it was able to be saved and if not denies that book.
Fixed:
- When trying to sell a book that has a huge character amount it causes an error in console and creates a dup bug. A limit of 2k characters has been added to help prevent this.
Note: If this seems to high or low it will be changed later.
Added:
- New Book-Not-Allowed message in the Messages.yml.
Removed:
- Written book was removed from the blacklist as this should fix any issue they caused.
Even with illegalstack installed players are able to use mods to list an invalid book on the AH to crash it. Ie the ah will no longer open for others until written books are added to the blacklist
Tested that and perfectly working ! Results are interesting and offer a fantastic decrease of the used performance. (With the startCheck() task, 13% to 0 - 1% according to Paper's timings).
Explainations:
I had to deal with this problem for a while and haven't received a satisfactory answer on your Discord (just "You have to recode the plugin"). So I decided to analyze your code to improve it and I found a great solution! This method reads lines in the data file but doesn't necessarily have to save the file since it's in most cases unchanged. So I added a boolean that goes true when changes are made, forcing the data file being saved ;).
Enjoy