Advertisement
drazisil

Untitled

Dec 20th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. package com.drazisil.petguard;
  2.  
  3. import org.spongepowered.api.Game;
  4. import org.spongepowered.api.event.state.LoadCompleteEvent;
  5. import org.spongepowered.api.event.state.PreInitializationEvent;
  6. import org.spongepowered.api.event.state.ServerStartedEvent;
  7. import org.spongepowered.api.event.state.ServerStartingEvent;
  8. import org.spongepowered.api.plugin.Plugin;
  9. import org.spongepowered.api.text.message.Messages;
  10. import org.spongepowered.api.util.config.ConfigFile;
  11. import org.spongepowered.api.util.event.Subscribe;
  12.  
  13. import java.io.File;
  14. import java.sql.Connection;
  15. import java.sql.ResultSet;
  16. import java.util.ArrayList;
  17.  
  18. @Plugin(id = "petguard", name = "Pet Guard", version = "1.0")
  19. public class PetGuard {
  20.  
  21.     public static PetGuard plugin;
  22.     private File localConfigFile = null;
  23.     private ConfigFile localConfig = null;
  24.     static boolean flatfile;
  25.     private ConfigFile horseConfig;
  26.     ResultSet rs;
  27.     private File horseConfigFile;
  28.     Connection conn;
  29.     static boolean setup;
  30.     static ArrayList<String> randomNames = new ArrayList();
  31.     String petConfigFilename;
  32.     public static boolean enabled;
  33.     Game game;
  34.  
  35.  
  36.     @Subscribe
  37.     public void preInit(PreInitializationEvent event) {
  38.  
  39.         ConfigFile cfg = ConfigFile.parseFile(event.getRecommendedConfigurationFile());
  40.         enabled = cfg.getBoolean("general.enabled");
  41.  
  42.  
  43.     }
  44.  
  45.     @Subscribe
  46.     public void onStartup(ServerStartingEvent event){
  47.         game = event.getGame();
  48.  
  49.         game.getEventManager().register(this, new PetGuardListener(this));
  50.     }
  51.  
  52.     @Subscribe
  53.     public void onLoadComplete(LoadCompleteEvent event) {
  54.         game.broadcastMessage(Messages.of("Pet Guard Started"));
  55.  
  56.     }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement