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