Advertisement
Guest User

Untitled

a guest
May 4th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.88 KB | None | 0 0
  1. package us.enick.Quoter;
  2.  
  3. import java.io.File;
  4. import java.io.FileNotFoundException;
  5. import java.io.IOException;
  6.  
  7. import org.bukkit.ChatColor;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11. import org.bukkit.configuration.InvalidConfigurationException;
  12. import org.bukkit.configuration.file.FileConfiguration;
  13.  
  14. public class Main extends JavaPlugin{
  15.  
  16.     public static File configf;
  17.     public static FileConfiguration config;
  18.    
  19.     // Declare Quote variables
  20.     static String A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z;
  21.    
  22.     // Declare quote speaker variables
  23.     static String QuoterA, QuoterB, QuoterC, QuoterD, QuoterE, QuoterF, QuoterG, QuoterH, QuoterI, QuoterJ, QuoterK, QuoterL, QuoterM;
  24.     static String QuoterN, QuoterO, QuoterP, QuoterQ, QuoterR, QuoterS, QuoterT, QuoterU, QuoterV, QuoterW, QuoterX, QuoterY, QuoterZ;
  25.     public void onEnable() {
  26.        
  27.  
  28.         configf = new File(getDataFolder(), "config.yml");
  29.  
  30.                 if (!configf.exists()) {
  31.                         configf.getParentFile().mkdirs();
  32.                         try {
  33.                             config.load(configf);
  34.                         } catch (FileNotFoundException e) {
  35.                             // TODO Auto-generated catch block
  36.                             e.printStackTrace();
  37.                         } catch (IOException e) {
  38.                             // TODO Auto-generated catch block
  39.                             e.printStackTrace();
  40.                         } catch (InvalidConfigurationException e) {
  41.                             // TODO Auto-generated catch block
  42.                             e.printStackTrace();
  43.                         }
  44.  }
  45.  
  46.                 A = config.getString("A") == null ? "A" : config.getString("A");
  47.                 B = config.getString("B") == null ? "B" : config.getString("B");
  48.                 C = config.getString("C") == null ? "C" : config.getString("C");
  49.                 D = config.getString("D") == null ? "D" : config.getString("D");
  50.                 E = config.getString("E") == null ? "E" : config.getString("E");
  51.                 F = config.getString("F") == null ? "F" : config.getString("F");
  52.                 G = config.getString("G") == null ? "G" : config.getString("G");
  53.                 H = config.getString("H") == null ? "H" : config.getString("H");
  54.                 I = config.getString("I") == null ? "I" : config.getString("I");
  55.                 J = config.getString("J") == null ? "J" : config.getString("J");
  56.                 K = config.getString("K") == null ? "K" : config.getString("K");
  57.                 L = config.getString("L") == null ? "L" : config.getString("L");
  58.                 M = config.getString("M") == null ? "M" : config.getString("M");
  59.                 N = config.getString("N") == null ? "N" : config.getString("N");
  60.                 O = config.getString("O") == null ? "O" : config.getString("O");
  61.                 P = config.getString("P") == null ? "P" : config.getString("P");
  62.                 Q = config.getString("Q") == null ? "Q" : config.getString("Q");
  63.                 R = config.getString("R") == null ? "R" : config.getString("R");
  64.                 S = config.getString("S") == null ? "S" : config.getString("S");
  65.                 T = config.getString("T") == null ? "T" : config.getString("T");
  66.                 U = config.getString("U") == null ? "U" : config.getString("U");
  67.                 V = config.getString("V") == null ? "V" : config.getString("V");
  68.                 W = config.getString("W") == null ? "W" : config.getString("W");
  69.                 X = config.getString("X") == null ? "X" : config.getString("X");
  70.                 Y = config.getString("Y") == null ? "Y" : config.getString("Y");
  71.                 Z = config.getString("Z") == null ? "Z" : config.getString("Z");
  72.                
  73.                 QuoterA = config.getString("QuoterA") == null ? "QuoterA" : config.getString("QuoterA");
  74.                 QuoterB = config.getString("QuoterB") == null ? "QuoterB" : config.getString("QuoterB");
  75.                 QuoterC = config.getString("QuoterC") == null ? "QuoterC" : config.getString("QuoterC");
  76.                 QuoterD = config.getString("QuoterD") == null ? "QuoterD" : config.getString("QuoterD");
  77.                 QuoterE = config.getString("QuoterE") == null ? "QuoterE" : config.getString("QuoterE");
  78.                 QuoterF = config.getString("QuoterF") == null ? "QuoterF" : config.getString("QuoterF");
  79.                 QuoterG = config.getString("QuoterG") == null ? "QuoterG" : config.getString("QuoterG");
  80.                 QuoterH = config.getString("QuoterH") == null ? "QuoterH" : config.getString("QuoterH");
  81.                 QuoterI = config.getString("QuoterI") == null ? "QuoterI" : config.getString("QuoterI");
  82.                 QuoterJ = config.getString("QuoterJ") == null ? "QuoterJ" : config.getString("QuoterJ");
  83.                 QuoterK = config.getString("QuoterK") == null ? "QuoterK" : config.getString("QuoterK");
  84.                 QuoterL = config.getString("QuoterL") == null ? "QuoterL" : config.getString("QuoterL");
  85.                 QuoterM = config.getString("QuoterM") == null ? "QuoterM" : config.getString("QuoterM");
  86.                 QuoterN = config.getString("QuoterN") == null ? "QuoterN" : config.getString("QuoterN");
  87.                 QuoterO = config.getString("QuoterO") == null ? "QuoterO" : config.getString("QuoterO");
  88.                 QuoterP = config.getString("QuoterP") == null ? "QuoterP" : config.getString("QuoterP");
  89.                 QuoterQ = config.getString("QuoterQ") == null ? "QuoterQ" : config.getString("QuoterQ");
  90.                 QuoterR = config.getString("QuoterR") == null ? "QuoterR" : config.getString("QuoterR");
  91.                 QuoterS = config.getString("QuoterS") == null ? "QuoterS" : config.getString("QuoterS");
  92.                 QuoterT = config.getString("QuoterT") == null ? "QuoterT" : config.getString("QuoterT");
  93.                 QuoterU = config.getString("QuoterU") == null ? "QuoterU" : config.getString("QuoterU");
  94.                 QuoterV = config.getString("QuoterV") == null ? "QuoterV" : config.getString("QuoterV");
  95.                 QuoterW = config.getString("QuoterW") == null ? "QuoterW" : config.getString("QuoterW");
  96.                 QuoterX = config.getString("QuoterX") == null ? "QuoterX" : config.getString("QuoterX");
  97.                 QuoterY = config.getString("QuoterY") == null ? "QuoterY" : config.getString("QuoterY");
  98.                 QuoterZ = config.getString("QuoterZ") == null ? "QuoterZ" : config.getString("QuoterZ");
  99.                
  100. }
  101.     @Override
  102.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  103.         if(cmd.getName().equalsIgnoreCase("Quoter")){
  104.                 sender.sendMessage(ChatColor.GOLD + "/Quoter AE:" + ChatColor.WHITE + " Gives quotes A-E");
  105.                 sender.sendMessage(ChatColor.GOLD + "/Quoter FJ:" + ChatColor.WHITE + " Gives quotes F-J");
  106.                 sender.sendMessage(ChatColor.GOLD + "/Quoter KO:" + ChatColor.WHITE + " Gives quotes K-O");
  107.                 sender.sendMessage(ChatColor.GOLD + "/Quoter PT:" + ChatColor.WHITE + " Gives quotes P-T");
  108.                 sender.sendMessage(ChatColor.GOLD + "/Quoter UZ:" + ChatColor.WHITE + " Gives quotes U-Z");
  109.             if(args.length == 1){
  110.             if(args[0].equalsIgnoreCase("AE")){
  111.                 sender.sendMessage(ChatColor.GOLD + A + ChatColor.WHITE + QuoterA);
  112.                 sender.sendMessage(ChatColor.DARK_GREEN + B + ChatColor.WHITE + QuoterB);
  113.                 sender.sendMessage(ChatColor.GOLD + C + ChatColor.WHITE + QuoterC);
  114.                 sender.sendMessage(ChatColor.DARK_GREEN + D + ChatColor.WHITE + QuoterD);
  115.                 sender.sendMessage(ChatColor.GOLD + E + ChatColor.WHITE + QuoterE);
  116.                
  117.         }
  118.             if(args[0].equalsIgnoreCase("FJ")){
  119.                 sender.sendMessage(ChatColor.GOLD + F + ChatColor.WHITE + QuoterF);
  120.                 sender.sendMessage(ChatColor.DARK_GREEN + G + ChatColor.WHITE + QuoterG);
  121.                 sender.sendMessage(ChatColor.GOLD + H + ChatColor.WHITE + QuoterH);
  122.                 sender.sendMessage(ChatColor.DARK_GREEN + I + ChatColor.WHITE + QuoterI);
  123.                 sender.sendMessage(ChatColor.GOLD + J + ChatColor.WHITE + QuoterJ);
  124.                        
  125.     }
  126.             if(args[0].equalsIgnoreCase("KO")){
  127.                 sender.sendMessage(ChatColor.GOLD + K + ChatColor.WHITE + QuoterK);
  128.                 sender.sendMessage(ChatColor.DARK_GREEN + L + ChatColor.WHITE + QuoterL);
  129.                 sender.sendMessage(ChatColor.GOLD + M + ChatColor.WHITE + QuoterM);
  130.                 sender.sendMessage(ChatColor.DARK_GREEN + N + ChatColor.WHITE + QuoterN);
  131.                 sender.sendMessage(ChatColor.GOLD + O + ChatColor.WHITE + QuoterO);
  132.            
  133.     }
  134.             if(args[0].equalsIgnoreCase("PT")){
  135.                 sender.sendMessage(ChatColor.GOLD + P + ChatColor.WHITE + QuoterP);
  136.                 sender.sendMessage(ChatColor.DARK_GREEN + Q + ChatColor.WHITE + QuoterQ);
  137.                 sender.sendMessage(ChatColor.GOLD + R + ChatColor.WHITE + QuoterR);
  138.                 sender.sendMessage(ChatColor.DARK_GREEN + S + ChatColor.WHITE + QuoterS);
  139.                 sender.sendMessage(ChatColor.GOLD + T + ChatColor.WHITE + QuoterT);
  140.                        
  141.     }
  142.             if(args[0].equalsIgnoreCase("UZ")){
  143.                 sender.sendMessage(ChatColor.GOLD + U + ChatColor.WHITE + QuoterU);
  144.                 sender.sendMessage(ChatColor.DARK_GREEN + V + ChatColor.WHITE + QuoterV);
  145.                 sender.sendMessage(ChatColor.GOLD + W + ChatColor.WHITE + QuoterW);
  146.                 sender.sendMessage(ChatColor.DARK_GREEN + X + ChatColor.WHITE + QuoterX);
  147.                 sender.sendMessage(ChatColor.GOLD + Y + ChatColor.WHITE + QuoterY);
  148.                 sender.sendMessage(ChatColor.DARK_GREEN + Z + ChatColor.WHITE + QuoterZ);
  149.            
  150.     }
  151.             }
  152.     }
  153.         return false;
  154.     }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement