Due to a recent Spigot API addition, PINPrompt no longer needs to use NMS for updating inventory titles so I added a check to see if you have the new API and use that, else use the old NMS methods, they will also still be used on pre-1.19.4 versions.
Improved memory management of collections by reducing their initialization size and improved the player data collection by initializing it at the maximum player count, clamped to 4-64.
Reworked the language system and the language part of the config.yml.
Moved to a static Common util instead of a StringHelper instance.
Improved the reloading messages of the plugin to be sent to the player or console that requested it.
Changed the config.yml to use 2 spaces indentation and trimmed some empty lines and spaces.
Removed the v1 -> v2 database migration.
Repackaged the entire plugin internally and changed its name to PINPrompt from PinPrompt including the API events and more.
Improved the default command message and added /PINPrompt help (permission: pinprompt.command.help)
Grouped a bunch of config.yml settings into sections and changed a bunch of setting names.
Improved a bunch of config.yml comments.
Removed the player name cache system.
Moved all the managers into a singleton manager system.
Improved the head setup process and managing to use an enum and not 100 different classes.
Added pinp and pprompt aliases.
Remade the entire database system to be cleaner, more efficient and safer.
Fixed an issue where you'd have to enter your PIN right after creating it.
Fixed an issue where some code would still be processed even if the player was disallowed to enter the server due to being banned.
Improved the inventory title language by making it a single format that is repeated depending on the configured PIN length.
Added a database migrator for v2 -> v3.
Renamed Head Sets to Head Style.
Changed the ban config settings to a simple single setting.
Updated and added support for 1.19.
Bunch of misc changes, refactoring and performance improvements internally.
Config changes(Just delete your old config.yml and redo it)
READ ME IF UPDATING FROM v2.x.x To update to this version, update the plugin jar, backup your config.yml, delete it, start the server to generate the new config.yml and convert your old v2 database to the v3 database which may take a few seconds or a few minutes (a v2 database with 10k entries took less than a second for me personally), stop the server then configure the config.yml however you wish, and you are ready to go! If you using MySQL with multiple servers please make sure to not run v2 of this plugin on a converted v2 -> v3 database.
Due to the nature of this update, it has been marked as a BETA. I don't recommend using it on production servers in case of any issues I missed but please load it on your local machine or another server with a copy of your production data to test and make sure it works and most importantly converts your database.
Reduced the number of database calls needed when a player logins.
Some internal formatting and refactoring changes to remove pointless calls.
The local memory cache for player information will always get bypassed when getting information on a player that is joining, this should have always been the case due to removing the local memory cache for that player when they leave and obviously, they can't join again if they don't leave in the first place but this is just added protection like it should have been.
The plugin now clears the player's current attempt count when the player enters the correct pin. This fixes an issue where you could incorrectly enter your pin twice, get it correct then the next time you need to enter it again you'll only have one chance to get it correct instead of 3 due to the two previous attempts.
Fixed the player being removed from an internal map twice.
Optimized code for a metrics/bStats custom pie chart.
The player will now "fly" when entering their PIN to avoid getting kicked by Mojang's default Anti-cheat and to have a better user experience instead of falling over and over.
Added support for up to 8 digit PINs. That is now up to 43,046,721 combinations of PINs for you to use.
Changed the auto-completion suggestion when changing another player's PIN, now it'll just say <PIN> because doing a 43m for loop isn't the best and will crash any server.
Fixed bypassing max failed attempts allowing for brute-forcing by relogging before hitting the max pin attempts. Thanks @SimulNetwork for notifying me about this.
Changed the entire NMS system to a reflection system, normally you would see the change being the other way around but here is my reasoning: Previously I had to use 15 implementations (One for each NMS revision which can be multiple per Minecraft version) and it will obviously increase. Now I don't have to import hundreds of MB of depends each build. This isn't worth the amount of file size and the NMS code, which is very, very small and has only changed 3 times since 1.8 (6 years) so we waste a lot of code, now we just use 3 different versions instead of 15. This also has a small benefit of supporting future Minecraft versions without updating if nothing has changed. All reflection gets cached on startup so don't worry about performance.
No config changes.
I have tested this on multiple Minecraft versions and it should work fine, if there are any issues please revert back to 2.9.0 and report it to me. Due to the nature of 1.8 and the number of forks people use I can't test this version very well. Please quickly test on a development server before going live.
Added a new remove command. You can do /pinprompt remove to remove your own pin or you can do /pinprompt remove (player) to remove another player pin. Permission is pinprompt.command.remove and pinprompt.command.remove.other
The new lock command now deletes your current session so you'll have to enter the PIN if you relog without re-entering your PIN. A small oversight in the last update, I apologise.
Added a new lock command. The lock command acts the same as when you would need to enter your PIN when you login etc. but it won't time you out (Kick you), this way you can lock your account and go AFK without worry, then simply re-enter your PIN when you come back.
Fixed the timeout for entering the PIN being 1 tick off.
Moved the blindness potion effect into the task and is given every tick for a very short time instead of on join for 999999, fixes if the server shutdown during PIN entry and the player will get permanent blindness.
Added a new config setting that allows you to enable and set a server that the player will be sent to when they enter their PIN. Useful for making an "auth" sub-server of kind
Fixed an issue when checking for players that are entering a new pin. (Same issue with the blocked events before). Would always return true if there was at least one player entering a new pin.
Fixed how the pin inventory is created and stocked with heads, this fixes a reload bug when if you reloaded the plugin while players were entering their PIN they would break.
Note about data.yml changes:
If you want to update, you have to delete your data.yml or convert it into the new format which is very easy. Copy it like so with your data: