Skip to content
This repository has been archived by the owner. It is now read-only.

Integration

Gnat008 edited this page Jul 28, 2018 · 5 revisions
Clone this wiki locally

If you are a plugin developer that wants to interface with PWI in your own plugin, there are a couple things you can use. PWI has one event that can be listened to and cancelled, as well as an API class. Even though PWI is written in Kotlin, you should be able to use Java and it will still work just fine.

Events

InventoryLoadEvent [class]
This event is called before an inventory will be loaded. This event can be cancelled, and if cancelled PWI will not load the inventory.

You can get the cause of the event (a world change or a GameMode change), the Player involved in the event, both the old and new GameModes, and the Group that the player is going to.

InventoryLoadCompleteEvent [class]
This event is called after an inventory and stats have been applied to a Player.

API

PerWorldInventoryAPI [class]
This is a safe class you can use to get a little information out of PWI. You can get the class instance by doing:

PerWorldInventory pwi = (PerWorldInventory) Bukkit.getServer().getPluginManager().getPlugin("PerWorldInventory");
PerWorldInventoryAPI api = pwi.getPerWorldInventoryAPI();

Visit the class link above to view what methods are available to you.