Advertisement
Guest User

Main.java

a guest
Jan 31st, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. package ga.thedag.zplugin.main;
  2.  
  3. import ga.thedag.zplugin.commands.Base;
  4. import ga.thedag.zplugin.commands.fly.Fly;
  5. import ga.thedag.zplugin.commands.gamemode.Adventure;
  6. import ga.thedag.zplugin.commands.gamemode.Creative;
  7. import ga.thedag.zplugin.commands.gamemode.Survival;
  8. import ga.thedag.zplugin.commands.health.Heal;
  9. import ga.thedag.zplugin.commands.health.Hurt;
  10. import ga.thedag.zplugin.commands.home.Delhome;
  11. import ga.thedag.zplugin.commands.home.Home;
  12. import ga.thedag.zplugin.commands.home.Sethome;
  13. import ga.thedag.zplugin.commands.hunger.Feed;
  14. import ga.thedag.zplugin.commands.hunger.Starve;
  15. import ga.thedag.zplugin.commands.warp.Delwarp;
  16. import ga.thedag.zplugin.commands.warp.Setwarp;
  17. import ga.thedag.zplugin.commands.warp.Warp;
  18. import ga.thedag.zplugin.config.Config;
  19. import ga.thedag.zplugin.config.ConfigManager;
  20. import ga.thedag.zplugin.configs.Ranks;
  21. import ga.thedag.zplugin.events.PlayerChatEvent;
  22.  
  23. import org.bukkit.plugin.PluginManager;
  24. import org.bukkit.plugin.java.JavaPlugin;
  25.  
  26. public class Main extends JavaPlugin {
  27. public Config homeConf;
  28. public Config warpConf;
  29. public Config rankConf;
  30. public Config playerConf;
  31. ConfigManager confManager;
  32. PluginManager pm = getServer().getPluginManager();
  33. Ranks ranks = new Ranks(this);
  34.  
  35. @Override
  36. public void onEnable() {
  37. confManager = new ConfigManager(this);
  38. homeConf = confManager.getNewConfig("homes.yml");
  39. warpConf = confManager.getNewConfig("warps.yml");
  40. rankConf = confManager.getNewConfig("/ranks/ranks.yml");
  41. playerConf = confManager.getNewConfig("/ranks/players.yml");
  42.  
  43. getCommand("zplugin").setExecutor(new Base(this));
  44. getCommand("sethome").setExecutor(new Sethome(this));
  45. getCommand("home").setExecutor(new Home(this));
  46. getCommand("delhome").setExecutor(new Delhome(this));
  47. getCommand("setwarp").setExecutor(new Setwarp(this));
  48. getCommand("warp").setExecutor(new Warp(this));
  49. getCommand("delwarp").setExecutor(new Delwarp(this));
  50. getCommand("adventure").setExecutor(new Adventure(this));
  51. getCommand("survival").setExecutor(new Survival(this));
  52. getCommand("creative").setExecutor(new Creative(this));
  53. getCommand("fly").setExecutor(new Fly(this));;
  54. getCommand("heal").setExecutor(new Heal(this));
  55. getCommand("feed").setExecutor(new Feed(this));
  56. getCommand("hurt").setExecutor(new Hurt(this));
  57. getCommand("starve").setExecutor(new Starve(this));
  58.  
  59. pm.registerEvents(new PlayerChatEvent(), this);
  60.  
  61. ranks.makeConf();
  62. }
  63. @Override
  64. public void onDisable() {
  65. homeConf.saveConfig();
  66. warpConf.saveConfig();
  67. }
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement