Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package us.enick.Quoter;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.configuration.InvalidConfigurationException;
- import org.bukkit.configuration.file.FileConfiguration;
- public class Main extends JavaPlugin{
- public static File configf;
- public static FileConfiguration config;
- // Declare Quote variables
- 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;
- // Declare quote speaker variables
- static String QuoterA, QuoterB, QuoterC, QuoterD, QuoterE, QuoterF, QuoterG, QuoterH, QuoterI, QuoterJ, QuoterK, QuoterL, QuoterM;
- static String QuoterN, QuoterO, QuoterP, QuoterQ, QuoterR, QuoterS, QuoterT, QuoterU, QuoterV, QuoterW, QuoterX, QuoterY, QuoterZ;
- public void onEnable() {
- configf = new File(getDataFolder(), "config.yml");
- if (!configf.exists()) {
- configf.getParentFile().mkdirs();
- try {
- config.load(configf);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvalidConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- A = config.getString("A") == null ? "A" : config.getString("A");
- B = config.getString("B") == null ? "B" : config.getString("B");
- C = config.getString("C") == null ? "C" : config.getString("C");
- D = config.getString("D") == null ? "D" : config.getString("D");
- E = config.getString("E") == null ? "E" : config.getString("E");
- F = config.getString("F") == null ? "F" : config.getString("F");
- G = config.getString("G") == null ? "G" : config.getString("G");
- H = config.getString("H") == null ? "H" : config.getString("H");
- I = config.getString("I") == null ? "I" : config.getString("I");
- J = config.getString("J") == null ? "J" : config.getString("J");
- K = config.getString("K") == null ? "K" : config.getString("K");
- L = config.getString("L") == null ? "L" : config.getString("L");
- M = config.getString("M") == null ? "M" : config.getString("M");
- N = config.getString("N") == null ? "N" : config.getString("N");
- O = config.getString("O") == null ? "O" : config.getString("O");
- P = config.getString("P") == null ? "P" : config.getString("P");
- Q = config.getString("Q") == null ? "Q" : config.getString("Q");
- R = config.getString("R") == null ? "R" : config.getString("R");
- S = config.getString("S") == null ? "S" : config.getString("S");
- T = config.getString("T") == null ? "T" : config.getString("T");
- U = config.getString("U") == null ? "U" : config.getString("U");
- V = config.getString("V") == null ? "V" : config.getString("V");
- W = config.getString("W") == null ? "W" : config.getString("W");
- X = config.getString("X") == null ? "X" : config.getString("X");
- Y = config.getString("Y") == null ? "Y" : config.getString("Y");
- Z = config.getString("Z") == null ? "Z" : config.getString("Z");
- QuoterA = config.getString("QuoterA") == null ? "QuoterA" : config.getString("QuoterA");
- QuoterB = config.getString("QuoterB") == null ? "QuoterB" : config.getString("QuoterB");
- QuoterC = config.getString("QuoterC") == null ? "QuoterC" : config.getString("QuoterC");
- QuoterD = config.getString("QuoterD") == null ? "QuoterD" : config.getString("QuoterD");
- QuoterE = config.getString("QuoterE") == null ? "QuoterE" : config.getString("QuoterE");
- QuoterF = config.getString("QuoterF") == null ? "QuoterF" : config.getString("QuoterF");
- QuoterG = config.getString("QuoterG") == null ? "QuoterG" : config.getString("QuoterG");
- QuoterH = config.getString("QuoterH") == null ? "QuoterH" : config.getString("QuoterH");
- QuoterI = config.getString("QuoterI") == null ? "QuoterI" : config.getString("QuoterI");
- QuoterJ = config.getString("QuoterJ") == null ? "QuoterJ" : config.getString("QuoterJ");
- QuoterK = config.getString("QuoterK") == null ? "QuoterK" : config.getString("QuoterK");
- QuoterL = config.getString("QuoterL") == null ? "QuoterL" : config.getString("QuoterL");
- QuoterM = config.getString("QuoterM") == null ? "QuoterM" : config.getString("QuoterM");
- QuoterN = config.getString("QuoterN") == null ? "QuoterN" : config.getString("QuoterN");
- QuoterO = config.getString("QuoterO") == null ? "QuoterO" : config.getString("QuoterO");
- QuoterP = config.getString("QuoterP") == null ? "QuoterP" : config.getString("QuoterP");
- QuoterQ = config.getString("QuoterQ") == null ? "QuoterQ" : config.getString("QuoterQ");
- QuoterR = config.getString("QuoterR") == null ? "QuoterR" : config.getString("QuoterR");
- QuoterS = config.getString("QuoterS") == null ? "QuoterS" : config.getString("QuoterS");
- QuoterT = config.getString("QuoterT") == null ? "QuoterT" : config.getString("QuoterT");
- QuoterU = config.getString("QuoterU") == null ? "QuoterU" : config.getString("QuoterU");
- QuoterV = config.getString("QuoterV") == null ? "QuoterV" : config.getString("QuoterV");
- QuoterW = config.getString("QuoterW") == null ? "QuoterW" : config.getString("QuoterW");
- QuoterX = config.getString("QuoterX") == null ? "QuoterX" : config.getString("QuoterX");
- QuoterY = config.getString("QuoterY") == null ? "QuoterY" : config.getString("QuoterY");
- QuoterZ = config.getString("QuoterZ") == null ? "QuoterZ" : config.getString("QuoterZ");
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if(cmd.getName().equalsIgnoreCase("Quoter")){
- sender.sendMessage(ChatColor.GOLD + "/Quoter AE:" + ChatColor.WHITE + " Gives quotes A-E");
- sender.sendMessage(ChatColor.GOLD + "/Quoter FJ:" + ChatColor.WHITE + " Gives quotes F-J");
- sender.sendMessage(ChatColor.GOLD + "/Quoter KO:" + ChatColor.WHITE + " Gives quotes K-O");
- sender.sendMessage(ChatColor.GOLD + "/Quoter PT:" + ChatColor.WHITE + " Gives quotes P-T");
- sender.sendMessage(ChatColor.GOLD + "/Quoter UZ:" + ChatColor.WHITE + " Gives quotes U-Z");
- if(args.length == 1){
- if(args[0].equalsIgnoreCase("AE")){
- sender.sendMessage(ChatColor.GOLD + A + ChatColor.WHITE + QuoterA);
- sender.sendMessage(ChatColor.DARK_GREEN + B + ChatColor.WHITE + QuoterB);
- sender.sendMessage(ChatColor.GOLD + C + ChatColor.WHITE + QuoterC);
- sender.sendMessage(ChatColor.DARK_GREEN + D + ChatColor.WHITE + QuoterD);
- sender.sendMessage(ChatColor.GOLD + E + ChatColor.WHITE + QuoterE);
- }
- if(args[0].equalsIgnoreCase("FJ")){
- sender.sendMessage(ChatColor.GOLD + F + ChatColor.WHITE + QuoterF);
- sender.sendMessage(ChatColor.DARK_GREEN + G + ChatColor.WHITE + QuoterG);
- sender.sendMessage(ChatColor.GOLD + H + ChatColor.WHITE + QuoterH);
- sender.sendMessage(ChatColor.DARK_GREEN + I + ChatColor.WHITE + QuoterI);
- sender.sendMessage(ChatColor.GOLD + J + ChatColor.WHITE + QuoterJ);
- }
- if(args[0].equalsIgnoreCase("KO")){
- sender.sendMessage(ChatColor.GOLD + K + ChatColor.WHITE + QuoterK);
- sender.sendMessage(ChatColor.DARK_GREEN + L + ChatColor.WHITE + QuoterL);
- sender.sendMessage(ChatColor.GOLD + M + ChatColor.WHITE + QuoterM);
- sender.sendMessage(ChatColor.DARK_GREEN + N + ChatColor.WHITE + QuoterN);
- sender.sendMessage(ChatColor.GOLD + O + ChatColor.WHITE + QuoterO);
- }
- if(args[0].equalsIgnoreCase("PT")){
- sender.sendMessage(ChatColor.GOLD + P + ChatColor.WHITE + QuoterP);
- sender.sendMessage(ChatColor.DARK_GREEN + Q + ChatColor.WHITE + QuoterQ);
- sender.sendMessage(ChatColor.GOLD + R + ChatColor.WHITE + QuoterR);
- sender.sendMessage(ChatColor.DARK_GREEN + S + ChatColor.WHITE + QuoterS);
- sender.sendMessage(ChatColor.GOLD + T + ChatColor.WHITE + QuoterT);
- }
- if(args[0].equalsIgnoreCase("UZ")){
- sender.sendMessage(ChatColor.GOLD + U + ChatColor.WHITE + QuoterU);
- sender.sendMessage(ChatColor.DARK_GREEN + V + ChatColor.WHITE + QuoterV);
- sender.sendMessage(ChatColor.GOLD + W + ChatColor.WHITE + QuoterW);
- sender.sendMessage(ChatColor.DARK_GREEN + X + ChatColor.WHITE + QuoterX);
- sender.sendMessage(ChatColor.GOLD + Y + ChatColor.WHITE + QuoterY);
- sender.sendMessage(ChatColor.DARK_GREEN + Z + ChatColor.WHITE + QuoterZ);
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement