SHARE
TWEET

Main file

a guest Apr 10th, 2011 2,321 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.SySammy.sdRankingSys;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import java.util.logging.Logger;
  6. import javax.persistence.PersistenceException;
  7. import org.bukkit.plugin.PluginDescriptionFile;
  8. import org.bukkit.plugin.PluginManager;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. /**
  12.  *
  13.  * @author Sammy
  14.  */
  15. public class sdRS extends JavaPlugin {
  16.  
  17.     private static final Logger log = Logger.getLogger("Minecraft");
  18.  
  19.     public static void main(String[] args) {
  20.         // TODO code application logic here
  21.     }
  22.  
  23.     public void onDisable() {
  24.         System.out.println("disabled, goodbye wold");
  25.     }
  26.  
  27.     public void onEnable() {
  28.         PluginDescriptionFile pdfFile = this.getDescription();
  29.         PluginManager pm = getServer().getPluginManager();
  30.  
  31.         setupDatabase();
  32.         getCommand("rank").setExecutor(new sdRankCmds(this));
  33.         System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
  34.     }
  35.  
  36.     private void setupDatabase() {
  37.         try {
  38.             getDatabase().find(Ranks.class).findRowCount();
  39.         } catch (PersistenceException ex) {
  40.             System.out.println("Installing database for " + getDescription().getName() + " due to first time usage");
  41.             installDDL();
  42.         }
  43.     }
  44.  
  45.     @Override
  46.     public List<Class<?>> getDatabaseClasses() {
  47.         List<Class<?>> list = new ArrayList<Class<?>>();
  48.         list.add(Ranks.class);
  49.         return list;
  50.     }
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top