Guest User

Untitled

a guest
Jan 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. package ga.yourmcgeek.util;
  2.  
  3. import com.google.inject.Inject;
  4. import ga.yourmcgeek.util.commands.ForumCommand;
  5. import ga.yourmcgeek.util.commands.LinkingCommand;
  6. import ga.yourmcgeek.util.commands.VersionsCommand;
  7. import ga.yourmcgeek.util.commands.WikiCommand;
  8. import ga.yourmcgeek.util.config.Configuration;
  9. import org.slf4j.Logger;
  10. import org.spongepowered.api.Sponge;
  11. import org.spongepowered.api.command.spec.CommandSpec;
  12. import org.spongepowered.api.config.DefaultConfig;
  13. import org.spongepowered.api.event.Listener;
  14. import org.spongepowered.api.event.game.state.GameStartedServerEvent;
  15. import org.spongepowered.api.plugin.Plugin;
  16. import org.spongepowered.api.text.Text;
  17.  
  18. import java.io.File;
  19.  
  20. @Plugin(
  21. id = "util",
  22. name = "Util",
  23. description = "Utils Plugin",
  24. authors = "YourMCGeek"
  25. )
  26. public class Util {
  27.  
  28. // Sponge provides a default Logger instance to all plugins
  29. // as long as @Inject is used.
  30. @Inject
  31. private Logger logger;
  32.  
  33. @Inject
  34. @DefaultConfig(sharedRoot = true)
  35. public File defaultConfig;
  36.  
  37. public Configuration config;
  38.  
  39.  
  40.  
  41.  
  42. @Listener
  43. public void onServerStart(GameStartedServerEvent event) {
  44.  
  45. int x = 0;
  46.  
  47. this.logger.info("Generating Utils...");
  48.  
  49. new WikiCommand(this).register();
  50. x++;
  51. this.logger.info("Wiki Util initialized.");
  52.  
  53.  
  54. new VersionsCommand(this).register();
  55. x++;
  56. this.logger.info("Versions Util initialized.");
  57.  
  58.  
  59. new LinkingCommand(this).register();
  60. x++;
  61. this.logger.info("Linking Util initialized.");
  62.  
  63.  
  64. new ForumCommand(this).register();
  65. x++;
  66. this.logger.info("Forum Util initialized.");
  67.  
  68. this.logger.info("Util Generation Completed. " + x + " utils generated.");
  69.  
  70.  
  71. }
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. public Logger getLogger() {
  80. return logger;
  81. }
  82.  
  83. public Configuration getConfig() {
  84. return config;
  85. }
  86.  
  87. }
Add Comment
Please, Sign In to add comment