Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. public class Housing extends JavaPlugin {
  2.  
  3. private static Housing instance;
  4. public static Housing getInstance() {
  5. return instance;
  6. }
  7.  
  8. InventoryManager invmanager;
  9.  
  10. public void onEnable() {
  11. instance = this;
  12. invmanager = new InventoryManager(this);
  13. registerCommands();
  14. registerPlotSquared();
  15. registerPlaceholders();
  16. loadConfig();
  17. Bukkit.getServer().getPluginManager().registerEvents(new SetupHousing(), this);
  18. }
  19.  
  20. public void onDisable() {}
  21.  
  22. public void registerCommands() {
  23. getCommand("housing").setExecutor(new HousingCommand());
  24. }
  25.  
  26. public void registerPlaceholders() {
  27. if(Bukkit.getPluginManager().isPluginEnabled("MVdWPlaceholderAPI")) {
  28. log("MVdWPlaceholderAPI found, loading placeholders...");
  29. }else {
  30. log("MVdWPlaceholderAPI was not found.");
  31. log("Disabling housing placeholders...");
  32. }
  33. }
  34.  
  35. public void registerPlotSquared() {
  36. if(Bukkit.getPluginManager().isPluginEnabled("PlotSquared")) {
  37. log("PlotSquared found, loading housing...");
  38. }else {
  39. log("PlotSquared was not found.");
  40. log("Housing will NOT work without this, disabling.");
  41. Bukkit.getPluginManager().disablePlugin(this);
  42. }
  43. }
  44.  
  45. public void loadConfig() {
  46. getConfig().options().copyDefaults(true);
  47. saveConfig();
  48. }
  49.  
  50. public void log(String s) {
  51. getServer().getConsoleSender().sendMessage(ChatUtil.format(s));
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement