Advertisement
Guest User

SimpleVanish Main Class

a guest
Mar 6th, 2014
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. package net.imphantom.simplevanish;
  2.  
  3. import java.io.File;
  4. import java.util.logging.Logger;
  5.  
  6. import net.imphantom.simplevanish.command.*;
  7.  
  8. import org.bukkit.configuration.file.FileConfiguration;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class SimpleVanish extends JavaPlugin{
  12.    
  13.     Logger logger = Logger.getLogger("Minecraft");
  14.     FileConfiguration config;
  15.    
  16.     @Override
  17.     public void onEnable() {
  18.         logger.info("No errors with SimpleVanish");
  19.        
  20.         if(getConfig().getBoolean("SimpleVanish.Enabled") == true) {
  21.             getCommand("simplevanish").setExecutor(new CommandSimpleVanish());
  22.             getCommand("vanish").setExecutor(new CommandVanish());
  23.         }
  24.        
  25.         File f = new File(getDataFolder() + "/");
  26.         if(!f.exists()) {
  27.             f.mkdir();
  28.         }
  29.         initConfig();
  30.     }
  31.    
  32.     private void initConfig() {
  33.         FileConfiguration config = getConfig();
  34.        
  35.         config.addDefault("SimpleVanish.Enabled", true);
  36.         config.addDefault("SimpleVanish.Hide-From-Player-List", false);
  37.        
  38.         config.options().copyDefaults(true);
  39.         saveConfig();
  40.     }
  41.    
  42.     @Override
  43.     public void onDisable() {
  44.         logger.info("SimpleVanish Disabled.");
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement