2018-11-07 23:59:42 +01:00
|
|
|
# API Usage
|
|
|
|
You have to import ChestSort.jar into your BuildPath.
|
|
|
|
|
|
|
|
Then you can access it via the plugin manager:
|
|
|
|
|
|
|
|
```
|
2018-11-08 00:00:24 +01:00
|
|
|
JeffChestSortPlugin chestSort = (JeffChestSortPlugin) getServer().getPluginManager().getPlugin("ChestSort");
|
2018-11-07 23:59:42 +01:00
|
|
|
|
2018-11-08 00:00:24 +01:00
|
|
|
if(chestSort==null || !(chestSort instanceof JeffChestSortPlugin)) {
|
|
|
|
getLogger().warning("ChestSort plugin not found.");
|
|
|
|
}
|
2018-11-07 23:59:42 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Now, you can sort any Inventory! Just like this:
|
|
|
|
|
|
|
|
```
|
2018-11-08 00:00:24 +01:00
|
|
|
Inventory inv = ...
|
|
|
|
chestSort.sortInventory(inv);
|
|
|
|
```
|