main/API
You want to hook into SpoutBackpack? Fine, I have what you need.
1) Import BukkitInventoryTools.jar as a library in your project
Import dk.gabriel333.BITBackpack.BITBackpackAPI
2) In your main class, add this object creation:
public BITBackpackAPI bitBackpack;
3) Somewhere on your onEnable, add this line :
setupBITBackpack();
4) So, this is the setupBITBackpack function :
private void setupBITBackpack() { if (bitBackpack != null) { return; } Plugin bitBackpack = this.getServer().getPluginManager().getPlugin("BukkitInventoryTools"); if (bitBackpack == null) { return; } bitBackpack = new BITBackpackAPI(); return; }
5) To check somewhere in your code if BITBackpack is enabled, use :
if (bitBackpack != null) { return; }
6) And finally to use a method of BITBackpack :
bitBackpack.theMethodYouWant();
If you need more methods, or if I made a mistake, do not hesitate to contact me.
Comments