mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-11-30 06:33:27 +01:00
added API readme
This commit is contained in:
parent
5fd4a796db
commit
e6cb527e6a
19
HOW_TO_USE_API.md
Normal file
19
HOW_TO_USE_API.md
Normal file
@ -0,0 +1,19 @@
|
||||
# API Usage
|
||||
You have to import ChestSort.jar into your BuildPath.
|
||||
|
||||
Then you can access it via the plugin manager:
|
||||
|
||||
```
|
||||
JeffChestSortPlugin chestSort = (JeffChestSortPlugin) getServer().getPluginManager().getPlugin("ChestSort");
|
||||
|
||||
if(chestSort==null || !(chestSort instanceof JeffChestSortPlugin)) {
|
||||
getLogger().warning("ChestSort plugin not found.");
|
||||
}
|
||||
```
|
||||
|
||||
Now, you can sort any Inventory! Just like this:
|
||||
|
||||
```
|
||||
Inventory inv = ...
|
||||
chestSort.sortInventory(inv);
|
||||
```
|
Loading…
Reference in New Issue
Block a user