Advertisement
TechManDylan

TheReaperThatCares.java

Mar 11th, 2012
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.TechManDylan.bukkit.TheReaperThatCares;
  2.  
  3. import java.io.File;
  4.  
  5. import org.bukkit.configuration.file.FileConfiguration;
  6. import org.bukkit.plugin.PluginManager;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public class TheReaperThatCares extends JavaPlugin {
  10.     FileConfiguration config;
  11.     //////////////////////////
  12.     //When Plugin is enabled//
  13.     //////////////////////////
  14.     public void onEnable(){
  15.         try{
  16.             /////////////////////////////
  17.             //Config is get config file//
  18.             /////////////////////////////
  19.             config = getConfig();
  20.             ///////////////////////////
  21.             //Make Config Directory//
  22.             ///////////////////////////
  23.             File TheReaperThatCares = new File (getDataFolder() + "config.yml");
  24.             ///////////////////////////
  25.             // Making the config file//
  26.             ///////////////////////////
  27.             if(!config.contains("Config.NoExpLoss.Void")) {
  28.  
  29.                 config.set("Config.ExpLoss.Void", true);
  30.  
  31.                 }
  32.             if(!config.contains("Config.NoExpLoss.Lightning")) {
  33.  
  34.                 config.set("Config.ExpLoss.Lightning", true);
  35.  
  36.                 }  
  37.             if(!config.contains("Config.NoExpLoss.Fall")) {
  38.  
  39.                 config.set("Config.ExpLoss.Fall", true);
  40.  
  41.                 }
  42.             if(!config.contains("Config.NoExpLoss.Fire")) {
  43.  
  44.                 config.set("Config.ExpLoss.Fire", true);
  45.  
  46.                 }
  47.             if(!config.contains("Config.NoExpLoss.Fire_Tick")) {
  48.  
  49.                 config.set("Config.ExpLoss.Fire", true);
  50.  
  51.                 }
  52.             if(!config.contains("Config.NoExpLoss.Lava")) {
  53.  
  54.                 config.set("Config.ExpLoss.Lava", true);
  55.  
  56.                 }  
  57.             if(!config.contains("Config.NoExpLoss.Suffocation")) {
  58.  
  59.                 config.set("Config.ExpLoss.Suffocation", true);
  60.  
  61.                 }  
  62.             if(!config.contains("Config.NoExpLoss.Drowning")) {
  63.  
  64.                 config.set("Config.ExpLoss.Drowning", true);
  65.  
  66.                 }  
  67.             if(!config.contains("Config.NoExpLoss.Suicide")) {
  68.  
  69.                 config.set("Config.ExpLoss.Suicide", true);
  70.  
  71.                 }  
  72.             if(!config.contains("Config.NoExpLoss.Starvation")) {
  73.  
  74.                 config.set("Config.ExpLoss.Starvation", true);
  75.  
  76.                 }  
  77.             if(!config.contains("Config.NoExpLoss.Poison")) {
  78.  
  79.                 config.set("Config.ExpLoss.Poison", true);
  80.  
  81.                 }  
  82.             if(!config.contains("Config.NoExpLoss.Contact")) {
  83.  
  84.                 config.set("Config.ExpLoss.Contact", true);
  85.  
  86.                 }  
  87.             if(!config.contains("Config.NoExpLoss.Entity Explosion")) {
  88.  
  89.                 config.set("Config.ExpLoss.Entity Explosion", true);
  90.  
  91.                 }  
  92.             if(!config.contains("Config.NoExpLoss.Block Explosion")) {
  93.  
  94.                 config.set("Config.ExpLoss.Block Explosion", true);
  95.  
  96.                 }
  97.             if(!config.contains("Config.NoExpLoss.Potion Damage")) {
  98.  
  99.                 config.set("Config.ExpLoss.Mob Potion Damage", true);
  100.  
  101.                 }  
  102.             if(!config.contains("Config.NoExpLoss.Player Attack")) {
  103.  
  104.                 config.set("Config.ExpLoss.Player Attack", true);
  105.  
  106.                 }  
  107.             if(!config.contains("Config.NoExpLoss.Mob Attack")) {
  108.  
  109.                 config.set("Config.ExpLoss.Mob Attack", true);
  110.  
  111.                 }  
  112.             if(!config.contains("Config.NoExpLoss.Player Projectile")) {
  113.  
  114.                 config.set("Config.ExpLoss.Player Projectile", true);
  115.  
  116.                 }
  117.             if(!config.contains("Config.NoExpLoss.Mob Projectile")) {
  118.  
  119.                 config.set("Config.ExpLoss.Mob Projectile", true);
  120.  
  121.                 }  
  122.             saveConfig();
  123.             /////////////////////
  124.             // Config file made//
  125.             /////////////////////
  126.            
  127.             //////////////////////////////
  128.             //Catch and print any errors//
  129.             //////////////////////////////
  130.         } catch(Exception e1) {
  131.             e1.printStackTrace();
  132.         }
  133.         PluginManager pm = this.getServer().getPluginManager();
  134.         pm.registerEvents(new TheReaperThatCaresPlayerListener(), this);
  135.         }
  136.     ///////////////////////////
  137.     //When plugin is disabled//
  138.     ///////////////////////////
  139.     public void onDisable(){
  140.        
  141.     }
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement