A Paper plugin for automatic chest and inventory sorting. Requires Paper 1.21.4 (or newer) and Java 21.
Please see the related topic at spigotmc.org for information regarding the commands, permissions and download links:
https://www.spigotmc.org/resources/1-13-chestsort.59773/
If you want to use ChestSort's advanced sorting features for your own plugin, you can use the ChestSort API. It provides methods to sort any given inventory, following the rules you have specified in your ChestSort's plugin.yml and the corresponding category files.
More information about the API can be found HERE.
This project uses Gradle. Build with:
gradle build
The resulting jar will be at build/libs/ChestSort-<version>.jar.
ChestSort takes an instance of org.bukkit.inventory.Inventory and copies the contents. The resulting array is sorted by rules defined in the config.yml. This takes far less than one millisecond for a whole chest, causing no noticeable lag even on servers where many players are using chests at the same time.