项目作者: XZot1K

项目描述 :
An amazing bukkit/spigot library and utility plugin used by the legendary XZot1K!
高级语言: Java
项目地址: git://github.com/XZot1K/ZotBox.git
创建时间: 2017-01-12T18:25:24Z
项目社区:https://github.com/XZot1K/ZotBox

开源协议:GNU General Public License v3.0

下载


How to use ZotBox

In order to properly use ZotBox you will need to be able to retrieve the Lib’s instance. You can do this by following these instructions:

  1. Download the ZotBox dependency and add it to your plugin’s dependencies.
  2. Make sure it is possible to grab the ZotBox instance from your Main class file. Example:
  1. import XZot1K.plugins.zl.ZotBox;
  2. import org.bukkit.plugin.java.JavaPlugin;
  3. import java.util.logging.Level;
  4. public final class Main extends JavaPlugin
  5. {
  6. private ZotBox zotBox;
  7. @Override
  8. public void onEnable()
  9. {
  10. if (!isZotBoxInstalled())
  11. {
  12. getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&e"
  13. + getName() + " &cwas unable to enable, due to &bZot&7Box &cnot being installed."));
  14. getServer().getPluginManager().disablePlugin(this);
  15. return;
  16. }
  17. getZotBox().getGeneralLibrary().sendConsoleMessage(this, "&aZotBox was found and has been successfully hooked into!");
  18. }
  19. private boolean isZotBoxInstalled()
  20. {
  21. ZotBox zotBox = (ZotBox) getServer().getPluginManager().getPlugin("ZotBox");
  22. if(zotBox != null)
  23. {
  24. setZotBox(zotBox);
  25. return true;
  26. }
  27. return false;
  28. }
  29. public ZotBox getZotBox()
  30. {
  31. return zotBox;
  32. }
  33. private void setZotBox(ZotBox zotBox)
  34. {
  35. this.zotBox = zotBox;
  36. }
  37. }
  1. Once 1 and 2 are completed, modify your “depends: []”, or “softdepends: []”, within your plugin.yml (This step is optional, but never hurts to make sure ZotBox is installed).
  2. Everything should be all set. As a test, call the getZotBox() method from your Main class and begin your adventure within ZotBox!