Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 52.85 KB | None | 0 0
  1. import java.net.SocketAddress;
  2. import java.util.ArrayList;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.Map;
  8. import java.util.Map.Entry;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11. import net.minecraft.server.MinecraftServer;
  12.  
  13. public class id extends ej
  14.         implements ef {
  15.  
  16.     public static Logger a = Logger.getLogger("Minecraft");
  17.     public bb b;
  18.     public boolean c = false;
  19.     private MinecraftServer d;
  20.     private ea e;
  21.     private int f = 0;
  22.     private double g;
  23.     private double h;
  24.     private double i;
  25.     private boolean j = true;
  26.     private gp k = null;
  27.     private List<String> onlyOneUseKits = new ArrayList<String>();
  28.  
  29.     public id(MinecraftServer paramMinecraftServer, bb parambb, ea paramea) {
  30.         this.d = paramMinecraftServer;
  31.         this.b = parambb;
  32.         parambb.a(this);
  33.         this.e = paramea;
  34.         paramea.a = this;
  35.     }
  36.  
  37.     public void a() {
  38.         this.b.a();
  39.         if (this.f++ % 20 == 0) {
  40.             this.b.a(new iz());
  41.         }
  42.     }
  43.  
  44.     public void c(String paramString) {
  45.         this.b.a(new io(paramString));
  46.         this.b.c();
  47.         this.d.f.c(this.e);
  48.         this.c = true;
  49.     }
  50.  
  51.     public void a(gf paramgf) {
  52.         double d1;
  53.         if (!this.j) {
  54.             d1 = paramgf.b - this.h;
  55.             if ((paramgf.a == this.g) && (d1 * d1 < 0.01D) && (paramgf.c == this.i)) {
  56.                 this.j = true;
  57.             }
  58.         }
  59.         if (this.j) {
  60.             this.g = this.e.l;
  61.             this.h = this.e.m;
  62.             this.i = this.e.n;
  63.  
  64.             d1 = this.e.l;
  65.             double d2 = this.e.m;
  66.             double d3 = this.e.n;
  67.  
  68.             float f1 = this.e.r;
  69.             float f2 = this.e.s;
  70.  
  71.             if (paramgf.h) {
  72.                 d1 = paramgf.a;
  73.                 d2 = paramgf.b;
  74.                 d3 = paramgf.c;
  75.                 double d4 = paramgf.d - paramgf.b;
  76.                 if ((d4 > 1.65D) || (d4 < 0.1D)) {
  77.                     c("Illegal stance");
  78.                     a.warning(this.e.aq + " had an illegal stance: " + d4);
  79.                 }
  80.                 this.e.ai = paramgf.d;
  81.             }
  82.             if (paramgf.i) {
  83.                 f1 = paramgf.e;
  84.                 f2 = paramgf.f;
  85.             }
  86.  
  87.             this.e.i();
  88.             this.e.M = 0.0F;
  89.             this.e.b(this.g, this.h, this.i, f1, f2);
  90.  
  91.             double d4 = d1 - this.e.l;
  92.             double d5 = d2 - this.e.m;
  93.             double d6 = d3 - this.e.n;
  94.  
  95.             float f3 = 0.0625F;
  96.             int m = this.d.e.a(this.e, this.e.v.b().e(f3, f3, f3)).size() == 0 ? 1 : 0;
  97.  
  98.             this.e.c(d4, d5, d6);
  99.             d4 = d1 - this.e.l;
  100.             d5 = d2 - this.e.m;
  101.             if ((d5 > -0.5D) || (d5 < 0.5D)) {
  102.                 d5 = 0.0D;
  103.             }
  104.             d6 = d3 - this.e.n;
  105.             double d7 = d4 * d4 + d5 * d5 + d6 * d6;
  106.             int n = 0;
  107.             if (d7 > 0.0625D) {
  108.                 n = 1;
  109.                 a.warning(this.e.aq + " moved wrongly!");
  110.             }
  111.             this.e.b(d1, d2, d3, f1, f2);
  112.  
  113.             int i1 = this.d.e.a(this.e, this.e.v.b().e(f3, f3, f3)).size() == 0 ? 1 : 0;
  114.             if ((m != 0) && ((n != 0) || (i1 == 0))) {
  115.                 a(this.g, this.h, this.i, f1, f2);
  116.                 return;
  117.             }
  118.  
  119.             this.e.w = paramgf.g;
  120.             this.d.f.b(this.e);
  121.         }
  122.     }
  123.  
  124.     public void a(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) {
  125.         this.j = false;
  126.         this.g = paramDouble1;
  127.         this.h = paramDouble2;
  128.         this.i = paramDouble3;
  129.         this.e.b(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2);
  130.         this.e.a.b(new dq(paramDouble1, paramDouble2 + 1.620000004768372D, paramDouble2, paramDouble3, paramFloat1, paramFloat2, false));
  131.     }
  132.  
  133.     //Destroy function
  134.     public void a(hd paramhd) {
  135.         this.e.aj.a[this.e.aj.d] = this.k;
  136.         boolean bool = this.d.e.z = (this.d.f.g(this.e.aq) || etc.getInstance().isAdmin(e));
  137.         int m = 0;
  138.         if (paramhd.e == 0) {
  139.             m = 1;
  140.         }
  141.         if (paramhd.e == 1) {
  142.             m = 1;
  143.         }
  144.  
  145.         if (m != 0) {
  146.             double d1 = this.e.m;
  147.             this.e.m = this.e.ai;
  148.             fr localfr = this.e.a(4.0D, 1.0F);
  149.             this.e.m = d1;
  150.             if (localfr == null) {
  151.                 return;
  152.             }
  153.             if ((localfr.b != paramhd.a) || (localfr.c != paramhd.b) || (localfr.d != paramhd.c) || (localfr.e != paramhd.d)) {
  154.                 return;
  155.             }
  156.         }
  157.         int n = paramhd.a;
  158.         int i1 = paramhd.b;
  159.         int i2 = paramhd.c;
  160.         int i3 = paramhd.d;
  161.         int i4 = (int) gj.e(n - this.d.e.n);
  162.         int i5 = (int) gj.e(i2 - this.d.e.p);
  163.         if (i4 > i5) {
  164.             i5 = i4;
  165.         }
  166.         if (paramhd.e == 0) {
  167.             if (!etc.getInstance().canBuild(e)) {
  168.                 return;
  169.             }
  170.             if (i5 > etc.getInstance().spawnProtectionSize || bool) {
  171.                 this.e.ad.a(n, i1, i2);
  172.             }
  173.         } else if (paramhd.e == 2) {
  174.             this.e.ad.a();
  175.         } else if (paramhd.e == 1) {
  176.             if (!etc.getInstance().canBuild(e)) {
  177.                 return;
  178.             }
  179.             if (i5 > etc.getInstance().spawnProtectionSize || bool) {
  180.                 this.e.ad.a(n, i1, i2, i3);
  181.             }
  182.         } else if (paramhd.e == 3) {
  183.             double d2 = this.e.l - (n + 0.5D);
  184.             double d3 = this.e.m - (i1 + 0.5D);
  185.             double d4 = this.e.n - (i2 + 0.5D);
  186.             double d5 = d2 * d2 + d3 * d3 + d4 * d4;
  187.             if (d5 < 256.0D) {
  188.                 this.e.a.b(new et(n, i1, i2, this.d.e));
  189.             }
  190.         }
  191.         this.d.e.z = false;
  192.     }
  193.  
  194.     //Build function
  195.     public void a(fe paramfe) {
  196.         if (!etc.getInstance().canBuild(e)) {
  197.             return;
  198.         }
  199.         boolean bool = this.d.e.z = (this.d.f.g(this.e.aq) || etc.getInstance().isAdmin(e));
  200.         int m = paramfe.b;
  201.         int n = paramfe.c;
  202.         int i1 = paramfe.d;
  203.         int i2 = paramfe.e;
  204.         int i3 = (int) gj.e(m - this.d.e.n);
  205.         int i4 = (int) gj.e(i1 - this.d.e.p);
  206.         if (i3 > i4) {
  207.             i4 = i3;
  208.         }
  209.         if (i4 > etc.getInstance().spawnProtectionSize || bool) {
  210.             gp localgp = paramfe.a >= 0 ? new gp(paramfe.a) : null;
  211.  
  212.             if (localgp != null) {
  213.                 if (!etc.getInstance().isOnItemBlacklist(localgp.c) || bool) {
  214.                     this.e.ad.a(this.e, this.d.e, localgp, m, n, i1, i2);
  215.                 }
  216.             } else {
  217.                 // is this right?
  218.                 this.e.ad.a(this.e, this.d.e, localgp, m, n, i1, i2);
  219.             }
  220.         }
  221.         this.e.a.b(new et(m, n, i1, this.d.e));
  222.         this.d.e.z = false;
  223.     }
  224.  
  225.     public void a(String paramString) {
  226.         a.info(this.e.aq + " lost connection: " + paramString);
  227.         this.d.f.c(this.e);
  228.         this.c = true;
  229.     }
  230.  
  231.     public void a(hp paramhp) {
  232.         a.warning(getClass() + " wasn't prepared to deal with a " + paramhp.getClass());
  233.         c("Protocol error, unexpected packet");
  234.     }
  235.  
  236.     public void b(hp paramhp) {
  237.         this.b.a(paramhp);
  238.     }
  239.  
  240.     public void a(fv paramfv) {
  241.         int m = paramfv.b;
  242.         this.e.aj.d = (this.e.aj.a.length - 1);
  243.         if (m == 0) {
  244.             this.k = null;
  245.         } else {
  246.             this.k = new gp(m);
  247.         }
  248.         this.e.aj.a[this.e.aj.d] = this.k;
  249.         this.d.k.a(this.e, new fv(this.e.c, m));
  250.     }
  251.  
  252.     public void a(k paramk) {
  253.         double d1 = paramk.b / 32.0D;
  254.         double d2 = paramk.c / 32.0D;
  255.         double d3 = paramk.d / 32.0D;
  256.         fn localfn = new fn(this.d.e, d1, d2, d3, new gp(paramk.h, paramk.i));
  257.         localfn.o = (paramk.e / 128.0D);
  258.         localfn.p = (paramk.f / 128.0D);
  259.         localfn.q = (paramk.g / 128.0D);
  260.         localfn.ad = 10;
  261.         this.d.e.a(localfn);
  262.     }
  263.  
  264.     private String colorChange(char colour)
  265.     {
  266.         String color = "";
  267.         switch(colour)
  268.         {
  269.             case '0':
  270.                 color = Colors.Black;
  271.                 break;
  272.             case '1':
  273.                 color = Colors.Navy;
  274.                 break;
  275.             case '2':
  276.                 color = Colors.Green;
  277.                 break;
  278.             case '3':
  279.                 color = Colors.Blue;
  280.                 break;
  281.             case '4':
  282.                 color = Colors.Red;
  283.                 break;
  284.             case '5':
  285.                 color = Colors.Purple;
  286.                 break;
  287.             case '6':
  288.                 color = Colors.Gold;
  289.                 break;
  290.             case '7':
  291.                 color = Colors.LightGray;
  292.                 break;
  293.             case '8':
  294.                 color = Colors.Gray;
  295.                 break;
  296.             case '9':
  297.                 color = Colors.DarkPurple;
  298.                 break;
  299.             case 'a':
  300.                 color = Colors.LightGreen;
  301.                 break;
  302.             case 'b':
  303.                 color = Colors.LightBlue;
  304.                 break;
  305.             case 'c':
  306.                 color = Colors.Rose;
  307.                 break;
  308.             case 'd':
  309.                 color = Colors.LightPurple;
  310.                 break;
  311.             case 'e':
  312.                 color = Colors.Yellow;
  313.                 break;
  314.             case 'f':
  315.                 color = Colors.White;
  316.                 break;
  317.             case 'A':
  318.                 color = Colors.LightGreen;
  319.                 break;
  320.             case 'B':
  321.                 color = Colors.LightBlue;
  322.                 break;
  323.             case 'C':
  324.                 color = Colors.Rose;
  325.                 break;
  326.             case 'D':
  327.                 color = Colors.LightPurple;
  328.                 break;
  329.             case 'E':
  330.                 color = Colors.Yellow;
  331.                 break;
  332.             case 'F':
  333.                 color = Colors.White;
  334.                 break;
  335.             default:
  336.                 color = Colors.White;
  337.                 break;
  338.         }
  339.         return color;
  340.     }
  341.  
  342.  
  343.     public void a(ba paramba) {
  344.         String str = paramba.a;
  345.         if (str.length() > 100) {
  346.             b("Chat message too long");
  347.             return;
  348.         }
  349.         str = str.trim();
  350.         for (int k = 0; k < str.length(); ++k) {
  351.             if (" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~|CueaaaaceeeiiiAAEaAooouuyOUo๏ฟกOร—?aiounNao?R๏ฟข??!&Lt;&Gt;".indexOf(str.charAt(k)) < 0) {
  352.                 b("Illegal characters in chat");
  353.                 return;
  354.             }
  355.         }
  356.  
  357.         if(str.length()>2) {
  358.             String temp = "";
  359.             for(int x = 0; x< str.length(); x++)
  360.             {
  361.                 if(str.charAt(x)=='^'&&x!=str.length()-1)
  362.                 {
  363.                     temp+=colorChange(str.charAt(x+1));
  364.                     x+=1;
  365.                 }
  366.                 else{
  367.                     temp+=str.charAt(x);
  368.                 }
  369.             }
  370.             str = temp + " ";
  371.         }
  372.     if (str.startsWith(">")) {
  373.             str = Colors.LightGreen + str;
  374.         }
  375.         if (str.startsWith("FFF")) {
  376.             str = Colors.Red + str;
  377.             }
  378.         if (str.startsWith("/")) {
  379.             d(str);
  380.         } else {
  381.             if (etc.getInstance().isMuted(e)) {
  382.                 msg(Colors.Rose + "You are currently muted.");
  383.                 return;
  384.             }
  385.             etc.getInstance().getLoader().callHook(PluginLoader.HOOKS.CHAT, new Object[]{e, str});
  386.             String message = "<" + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.White + "> " + str;
  387.             a.log(Level.INFO, "<" + e.aq + "> " + str);
  388.             this.d.f.a(new ba(message));
  389.         }
  390.     }
  391.  
  392.     private ea match(String name) {
  393.         ea player = null;
  394.         boolean found = false;
  395.         if (("`" + this.d.f.c().toUpperCase() + "`").split(name.toUpperCase()).length == 2) {
  396.             for (int i = 0; i < this.d.f.b.size() && !found; ++i) {
  397.                 ea localea = (ea) this.d.f.b.get(i);
  398.                 if (("`" + localea.aq.toUpperCase() + "`").split(name.toUpperCase()).length == 2) {
  399.                     player = localea;
  400.                     found = true;
  401.                 }
  402.             }
  403.         } else if (("`" + this.d.f.c() + "`").split(name).length > 2) {
  404.             // Too many partial matches.
  405.             for (int i = 0; i < this.d.f.b.size() && !found; ++i) {
  406.                 ea localea = (ea) this.d.f.b.get(i);
  407.                 if (localea.aq.equalsIgnoreCase(name)) {
  408.                     player = localea;
  409.                     found = true;
  410.                 }
  411.             }
  412.         }
  413.         return player;
  414.     }
  415.  
  416.     public static String combineSplit(int startIndex, String[] string, String seperator) {
  417.         StringBuilder builder = new StringBuilder();
  418.         for (int i = startIndex; i < string.length; i++) {
  419.             builder.append(string[i]);
  420.             builder.append(seperator);
  421.         }
  422.         builder.deleteCharAt(builder.length() - seperator.length()); // remove the extra
  423.         // seperator
  424.         return builder.toString();
  425.     }
  426.  
  427.     public boolean hasControlOver(ea player) {
  428.         boolean isInGroup = false;
  429.  
  430.         if (etc.getInstance().getUser(player.aq) != null) {
  431.             for (String str : etc.getInstance().getUser(player.aq).Groups) {
  432.                 if (etc.getInstance().isUserInGroup(e, str)) {
  433.                     isInGroup = true;
  434.                 }
  435.             }
  436.         } else {
  437.             return true;
  438.         }
  439.  
  440.         return isInGroup;
  441.     }
  442.  
  443.     public void msg(String msg) {
  444.         b(new ba(msg));
  445.     }
  446.  
  447.     private void d(String paramString) {
  448.         try {
  449.             if (etc.getInstance().isLogging()) {
  450.                 a.info("Command used by " + e.aq + " " + paramString);
  451.             }
  452.             String[] split = paramString.split(" ");
  453.             if (etc.getInstance().getLoader().callHook(PluginLoader.HOOKS.COMMAND, new Object[]{e, split})) {
  454.                 return; //No need to go on, commands were parsed.
  455.             }
  456.             if (!etc.getInstance().canUseCommand(e.aq, split[0]) && !split[0].startsWith("/#")) {
  457.                 msg(Colors.Rose + "Unknown command.");
  458.                 return;
  459.             }
  460.             if (split[0].equalsIgnoreCase("/help")) {
  461.                 //Meh, not the greatest way, but not the worst either.
  462.                 List<String> availableCommands = new ArrayList<String>();
  463.                 for (Entry<String, String> entry : etc.getInstance().commands.entrySet()) {
  464.                     if (etc.getInstance().canUseCommand(e.aq, entry.getKey())) {
  465.                         if (entry.getKey().equals("/kit") && !etc.getInstance().getDataSource().hasKits()) {
  466.                             continue;
  467.                         }
  468.                         if (entry.getKey().equals("/listwarps") && !etc.getInstance().getDataSource().hasWarps()) {
  469.                             continue;
  470.                         }
  471.  
  472.                         availableCommands.add(entry.getKey() + " " + entry.getValue());
  473.                     }
  474.                 }
  475.  
  476.                 msg(Colors.Blue + "Available commands (Page " + (split.length == 2 ? split[1] : "1") + " of " + (int) Math.ceil((double) availableCommands.size() / (double) 7) + ") [] = required <> = optional:");
  477.                 if (split.length == 2) {
  478.                     try {
  479.                         int amount = Integer.parseInt(split[1]);
  480.  
  481.                         if (amount > 0) {
  482.                             amount = (amount - 1) * 7;
  483.                         } else {
  484.                             amount = 0;
  485.                         }
  486.  
  487.                         for (int i = amount; i < amount + 7; i++) {
  488.                             if (availableCommands.size() > i) {
  489.                                 msg(Colors.Rose + availableCommands.get(i));
  490.                             }
  491.                         }
  492.                     } catch (NumberFormatException ex) {
  493.                         msg(Colors.Rose + "Not a valid page number.");
  494.                     }
  495.                 } else {
  496.                     for (int i = 0; i < 7; i++) {
  497.                         if (availableCommands.size() > i) {
  498.                             msg(Colors.Rose + availableCommands.get(i));
  499.                         }
  500.                     }
  501.                 }
  502.             } else if (split[0].equalsIgnoreCase("/reload")) {
  503.                 etc.getInstance().load();
  504.                 etc.getInstance().loadData();
  505.                 String reloadinfoz = Colors.GMSG +  etc.getInstance().getUserColor(e.aq) + e.aq + Colors.GMSG + " has reloaded the server configuration files.";
  506.                 this.d.f.a(new ba(reloadinfoz));
  507.                 a.info("Reloaded config");
  508.                 msg("Successfuly reloaded config");
  509.             } else if ((split[0].equalsIgnoreCase("/modify") || split[0].equalsIgnoreCase("/mp"))) {
  510.                 if (split.length < 4) {
  511.                     msg(Colors.Rose + "Usage is: /modify [player] [key] [value]");
  512.                     msg(Colors.Rose + "Keys:");
  513.                     msg(Colors.Rose + "prefix: only the letter the color represents");
  514.                     msg(Colors.Rose + "commands: list seperated by comma");
  515.                     msg(Colors.Rose + "groups: list seperated by comma");
  516.                     msg(Colors.Rose + "ignoresrestrictions: true or false");
  517.                     msg(Colors.Rose + "admin: true or false");
  518.                     msg(Colors.Rose + "modworld: true or false");
  519.                     return;
  520.                 }
  521.  
  522.                 ea player = match(split[1]);
  523.  
  524.                 if (player == null) {
  525.                     msg(Colors.Rose + "Player does not exist.");
  526.                     return;
  527.                 }
  528.  
  529.                 String key = split[2];
  530.                 String value = split[3];
  531.                 User user = etc.getInstance().getUser(split[1]);
  532.                 boolean newUser = false;
  533.  
  534.                 if (user == null) {
  535.                     if (!key.equalsIgnoreCase("groups") && !key.equalsIgnoreCase("g")) {
  536.                         msg(Colors.Rose + "When adding a new user, set their group(s) first.");
  537.                         return;
  538.                     }
  539.                     msg(Colors.Rose + "Adding new user.");
  540.                     newUser = true;
  541.                     user = new User();
  542.                     user.Name = split[1];
  543.                     user.Administrator = false;
  544.                     user.CanModifyWorld = true;
  545.                     user.IgnoreRestrictions = false;
  546.                     user.Commands = new String[]{""};
  547.                     user.Prefix = "";
  548.                 }
  549.  
  550.                 if (key.equalsIgnoreCase("prefix") || key.equalsIgnoreCase("p")) {
  551.                     user.Prefix = value;
  552.                 } else if (key.equalsIgnoreCase("commands") || key.equalsIgnoreCase("c")) {
  553.                     user.Commands = value.split(",");
  554.                 } else if (key.equalsIgnoreCase("groups") || key.equalsIgnoreCase("g")) {
  555.                     user.Groups = value.split(",");
  556.                 } else if (key.equalsIgnoreCase("ignoresrestrictions") || key.equalsIgnoreCase("ir")) {
  557.                     user.IgnoreRestrictions = value.equalsIgnoreCase("true") || value.equals("1");
  558.                 } else if (key.equalsIgnoreCase("admin") || key.equalsIgnoreCase("a")) {
  559.                     user.Administrator = value.equalsIgnoreCase("true") || value.equals("1");
  560.                 } else if (key.equalsIgnoreCase("modworld") || key.equalsIgnoreCase("mw")) {
  561.                     user.CanModifyWorld = value.equalsIgnoreCase("true") || value.equals("1");
  562.                 }
  563.  
  564.                 if (newUser) {
  565.                     etc.getInstance().getDataSource().addUser(user);
  566.                 } else {
  567.                     etc.getInstance().getDataSource().modifyUser(user);
  568.                 }
  569.                 msg(Colors.Rose + "Modified user.");
  570.                 a.info("Modifed user " + split[1] + ". " + key + " => " + value + " by " + e.aq);
  571.                 String modifications = Colors.GMSG + etc.getInstance().getUserColor(e.aq) + e.aq + Colors.GMSG + " changed " + split[2] + " to " + split[3] + " for " + player.aq;
  572.         this.d.f.a(new ba(modifications));
  573.             } else if (split[0].equalsIgnoreCase("/whitelist")) {
  574.                 if (split.length < 2) {
  575.                     msg(Colors.Rose + "whitelist [operation (toggle, add or remove)] <player>");
  576.                     return;
  577.                 }
  578.  
  579.                 if (split[1].equalsIgnoreCase("toggle")) {
  580.                     msg(Colors.Rose + (etc.getInstance().toggleWhitelist() ? "Whitelist enabled" : "Whitelist disabled"));
  581.                 } else if(split.length == 3) {
  582.                     if (split[1].equalsIgnoreCase("add")) {
  583.                         etc.getInstance().getDataSource().addToWhitelist(split[2]);
  584.                         msg(Colors.Rose + split[2] + " added to whitelist");
  585.                     } else if (split[1].equalsIgnoreCase("remove")) {
  586.                         etc.getInstance().getDataSource().removeFromWhitelist(split[2]);
  587.                         msg(Colors.Rose + split[2] + " removed from whitelist");
  588.                     } else {
  589.                         msg(Colors.Rose + "Invalid operation.");
  590.                     }
  591.                 } else {
  592.                     msg(Colors.Rose + "Invalid operation.");
  593.                 }
  594.             } else if (split[0].equalsIgnoreCase("/reservelist")) {
  595.                 if (split.length != 3) {
  596.                     msg(Colors.Rose + "reservelist [operation (add or remove)] [player]");
  597.                     return;
  598.                 }
  599.  
  600.                 if (split[1].equalsIgnoreCase("add")) {
  601.                     etc.getInstance().getDataSource().addToReserveList(split[2]);
  602.                     msg(Colors.Rose + split[2] + " added to reservelist");
  603.                 } else if (split[1].equalsIgnoreCase("remove")) {
  604.                     etc.getInstance().getDataSource().removeFromReserveList(split[2]);
  605.                     msg(Colors.Rose + split[2] + " removed from reservelist");
  606.                 } else {
  607.                     msg(Colors.Rose + "Invalid operation.");
  608.                 }
  609.             } else if (split[0].equalsIgnoreCase("/mute")) {
  610.                 if (split.length != 2) {
  611.                     msg(Colors.Rose + "Correct usage is: /mute [player]");
  612.                     return;
  613.                 }
  614.  
  615.                 ea player = match(split[1]);
  616.  
  617.                 if (player != null) {
  618.                     if (etc.getInstance().toggleMute(player)) {
  619.                         msg(Colors.Rose + "player was muted");
  620.                         String muteon = Colors.GMSG2 + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG2 + " has muted " + player.aq;
  621.             this.d.f.a(new ba(muteon));
  622.                     } else {
  623.                         msg(Colors.Rose + "player was unmuted");
  624.                         String muteoff = Colors.GMSG2 + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG2 + " has unmuted " + player.aq +  ", behave this time!";
  625.             this.d.f.a(new ba(muteoff));
  626.                     }
  627.                 } else {
  628.                     msg(Colors.Rose + "Can't find player " + split[1]);
  629.                 }
  630.             } else if ((split[0].equalsIgnoreCase("/msg") || split[0].equalsIgnoreCase("/tell")) || split[0].equalsIgnoreCase("/m")) {
  631.                 if (split.length < 3) {
  632.                     msg(Colors.Rose + "Correct usage is: /msg [player] [message]");
  633.                     return;
  634.                 }
  635.                 if (etc.getInstance().isMuted(e)) {
  636.                     msg(Colors.Rose + "You are currently muted.");
  637.                     return;
  638.                 }
  639.  
  640.                 ea player = match(split[1]);
  641.  
  642.                 if (player != null) {
  643.                     if (player.aq.equals(e.aq)) {
  644.                         msg(Colors.Rose + "You can't message yourself!");
  645.                         return;
  646.                     }
  647.                     String prefix = etc.getInstance().getUserColor(e.aq);
  648.  
  649.                     player.a.msg("(MSG) " + prefix + "<" + e.aq + "> " + Colors.White + combineSplit(2, split, " "));
  650.                     msg("(MSG) " + prefix + "<" + e.aq + "> " + Colors.White + combineSplit(2, split, " "));
  651.                 } else {
  652.                     msg(Colors.Rose + "Couldn't find player " + split[1]);
  653.                 }
  654.             } else if (split[0].equalsIgnoreCase("/kit") && etc.getInstance().getDataSource().hasKits()) {
  655.                 if (split.length != 2 && split.length != 3) {
  656.                     msg(Colors.Rose + "Available kits: " + Colors.White + etc.getInstance().getDataSource().getKitNames(e.aq));
  657.                     return;
  658.                 }
  659.  
  660.                 ea toGive = e;
  661.                 if (split.length > 2 && etc.getInstance().canIgnoreRestrictions(e)) {
  662.                     toGive = match(split[1]);
  663.                 }
  664.  
  665.                 Kit kit = etc.getInstance().getDataSource().getKit(split[1]);
  666.                 if (toGive != null) {
  667.                     if (kit != null) {
  668.                         if (!etc.getInstance().isUserInGroup(e, kit.Group) && !kit.Group.equals("")) {
  669.                             msg(Colors.Rose + "That kit does not exist.");
  670.                         } else if (onlyOneUseKits.contains(kit.Name)) {
  671.                             msg(Colors.Rose + "You can only get this kit once per login.");
  672.                         } else if (MinecraftServer.b.containsKey(this.e.aq + " " + kit.Name)) {
  673.                             msg(Colors.Rose + "You can't get this kit again for a while.");
  674.                         } else {
  675.                             if (!etc.getInstance().canIgnoreRestrictions(e)) {
  676.                                 if (kit.Delay >= 0) {
  677.                                     MinecraftServer.b.put(this.e.aq + " " + kit.Name, kit.Delay);
  678.                                 } else {
  679.                                     onlyOneUseKits.add(kit.Name);
  680.                                 }
  681.                             }
  682.  
  683.                             a.info(this.e.aq + " got a kit!");
  684.                             toGive.a.msg(Colors.Rose + "Enjoy this kit!");
  685.                             for (Map.Entry<String, Integer> entry : kit.IDs.entrySet()) {
  686.                                 try {
  687.                                     int itemId = 0;
  688.                                     try {
  689.                                         itemId = Integer.parseInt(entry.getKey());
  690.                                     } catch (NumberFormatException n) {
  691.                                         itemId = etc.getInstance().getDataSource().getItem(entry.getKey());
  692.                                     }
  693.  
  694.                                     int temp = kit.IDs.get(entry.getKey());
  695.                                     do {
  696.                                         if (temp - 64 >= 64) {
  697.                                             toGive.a(new gp(itemId, 64));
  698.                                         } else {
  699.                                             toGive.a(new gp(itemId, temp));
  700.                                         }
  701.                                         temp -= 64;
  702.                                     } while (temp >= 64);
  703.                                 } catch (Exception e1) {
  704.                                     a.info("Got an exception while giving out a kit (Kit name \"" + kit.Name + "\"). Are you sure all the Ids are numbers?");
  705.                                     msg(Colors.Rose + "The server encountered a problem while giving the kit :(");
  706.                                 }
  707.                             }
  708.                         }
  709.                     } else {
  710.                         msg(Colors.Rose + "That kit does not exist.");
  711.                     }
  712.                 } else {
  713.                     msg(Colors.Rose + "That user does not exist.");
  714.                 }
  715.             } else if (split[0].equalsIgnoreCase("/tp")) {
  716.                 if (split.length < 2) {
  717.                     msg(Colors.Rose + "Correct usage is: /tp [player]");
  718.                     return;
  719.                 }
  720.  
  721.                 ea player = match(split[1]);
  722.  
  723.                 if (this.e.aq.equalsIgnoreCase(split[1])) {
  724.                     msg(Colors.Rose + "You're already here!");
  725.                     return;
  726.                 }
  727.  
  728.                 if (player != null) {
  729.                     a.info(this.e.aq + " teleported to " + player.aq);
  730.                     a(player.l, player.m, player.n, player.r, player.s);
  731.                 } else {
  732.                     msg(Colors.Rose + "Can't find user " + split[1] + ".");
  733.                 }
  734.             } else if ((split[0].equalsIgnoreCase("/tphere") || split[0].equalsIgnoreCase("/s"))) {
  735.                 if (split.length < 2) {
  736.                     msg(Colors.Rose + "Correct usage is: /tphere [player]");
  737.                     return;
  738.                 }
  739.  
  740.                 ea player = match(split[1]);
  741.  
  742.                 if (this.e.aq.equalsIgnoreCase(split[1])) {
  743.                     msg(Colors.Rose + "Wow look at that! You teleported yourself to yourself!");
  744.                     return;
  745.                 }
  746.  
  747.                 if (player != null) {
  748.                     a.info(this.e.aq + " teleported " + player.aq + " to their self.");
  749.                     String tpheremsg = Colors.GMSG + player.aq + " was teleported to " + etc.getInstance().getUserColor(e.aq) + e.aq;
  750.                     this.d.f.a(new ba(tpheremsg));
  751.                     player.a.a(e.l, e.m, e.n, e.r, e.s);
  752.                 } else {
  753.                     msg(Colors.Rose + "Can't find user " + split[1] + ".");
  754.                 }
  755.             } else if (split[0].equalsIgnoreCase("/playerlist") || split[0].equalsIgnoreCase("/who")) {
  756.                 msg(Colors.Rose + "Player list (" + d.f.b.size() + "/" + etc.getInstance().playerLimit + "): " + Colors.White + d.f.c());
  757.             } else if (split[0].equalsIgnoreCase("/item") || split[0].equalsIgnoreCase("/i") || split[0].equalsIgnoreCase("/give")) {
  758.                 if (split.length < 2) {
  759.                     if (etc.getInstance().canIgnoreRestrictions(e)) {
  760.                         msg(Colors.Rose + "Correct usage is: /item [itemid] <amount> <player> (optional)");
  761.                     } else {
  762.                         msg(Colors.Rose + "Correct usage is: /item [itemid] <amount>");
  763.                     }
  764.                     return;
  765.                 }
  766.  
  767.                 ea toGive = e;
  768.                 if (split.length == 4 && etc.getInstance().canIgnoreRestrictions(e)) {
  769.                     toGive = match(split[3]);
  770.                 }
  771.  
  772.                 if (toGive != null) {
  773.                     try {
  774.                         int i2 = 0;
  775.                         try {
  776.                             i2 = Integer.parseInt(split[1]);
  777.                         } catch (NumberFormatException n) {
  778.                             i2 = etc.getInstance().getDataSource().getItem(split[1]);
  779.                         }
  780.                         int i3 = 1;
  781.                         if (split.length > 2) {
  782.                             i3 = Integer.parseInt(split[2]);
  783.                         }
  784.  
  785.                         String i2str = Integer.toString(i2);
  786.                         if (i3 == -1 && etc.getInstance().isAdmin(e)) {
  787.                             i3 = 255;
  788.                         } else if (i3 <= 0) {
  789.                             i3 = 1;
  790.                         }
  791.                         if (i3 > 64 && !etc.getInstance().canIgnoreRestrictions(this.e)) {
  792.                             i3 = 64;
  793.                         }
  794.  
  795.                         boolean allowedItem = false;
  796.                         if (!etc.getInstance().allowedItems[0].equals("") && (!etc.getInstance().canIgnoreRestrictions(this.e))) {
  797.                             for (String str : etc.getInstance().allowedItems) {
  798.                                 if (i2str.equals(str)) {
  799.                                     allowedItem = true;
  800.                                 }
  801.                             }
  802.                         } else {
  803.                             allowedItem = true;
  804.                         }
  805.                         if (!etc.getInstance().disallowedItems[0].equals("") && !etc.getInstance().canIgnoreRestrictions(this.e)) {
  806.                             for (String str : etc.getInstance().disallowedItems) {
  807.                                 if (i2str.equals(str)) {
  808.                                     allowedItem = false;
  809.                                 }
  810.                             }
  811.                         }
  812.                         if (i2 < ez.c.length) {
  813.                             if (ez.c[i2] != null && (allowedItem || etc.getInstance().canIgnoreRestrictions(this.e))) {
  814.                                 a.log(Level.INFO, "Giving " + toGive.aq + " some " + i2);
  815.                                 if (i3 == 255) {
  816.                                     toGive.a(new gp(i2, 255));
  817.                                 } else {
  818.                                     int temp = i3;
  819.                                     if (temp >= 257) {
  820.                                         msg(Colors.Red + "Are you trying to break the server?");
  821.                                         msg(Colors.Red + "The LIMIT is 256");
  822.                                         return;
  823.                                     }
  824.                                     do {
  825.                                         if (temp - 64 >= 64) {
  826.                                             toGive.a(new gp(i2, 64));
  827.                                         } else {
  828.                                             toGive.a(new gp(i2, temp));
  829.                                         }
  830.                                         temp -= 64;
  831.                                     } while (temp >= 64);
  832.                                 }
  833.  
  834.                                 if (toGive == this.e) {
  835.                                     msg(Colors.Rose + "There you go c:");
  836.                                 } else {
  837.                                     msg(Colors.Rose + "Gift given! :D");
  838.                                     toGive.a.msg(Colors.Rose + "Enjoy your gift! :D");
  839.                                 }
  840.                             } else if ((!allowedItem) && (ez.c[i2] != null) && !etc.getInstance().canIgnoreRestrictions(this.e)) {
  841.                                 msg(Colors.Rose + "You are not allowed to spawn that item.");
  842.                             } else {
  843.                                 msg(Colors.Rose + "No item with ID " + split[1]);
  844.                             }
  845.                         } else {
  846.                             msg(Colors.Rose + "No item with ID " + split[1]);
  847.                         }
  848.                     } catch (NumberFormatException localNumberFormatException) {
  849.                         msg(Colors.Rose + "Improper ID and/or amount.");
  850.                     }
  851.                 } else {
  852.                     msg(Colors.Rose + "Can't find user " + split[3]);
  853.                 }
  854.             } else if (split[0].equalsIgnoreCase("/tempban")) {
  855.                 // /tempban MINUTES HOURS DAYS
  856.                 if (split.length == 1) {
  857.                     //TODO;
  858.                     return;
  859.                 }
  860.                 int minutes = 0, hours = 0, days = 0;
  861.                 if (split.length >= 2) {
  862.                     minutes = Integer.parseInt(split[1]);
  863.                 }
  864.                 if (split.length >= 3) {
  865.                     hours = Integer.parseInt(split[2]);
  866.                 }
  867.                 if (split.length >= 4) {
  868.                     days = Integer.parseInt(split[3]);
  869.                 }
  870.                 Date date = new Date();
  871.                 //date.
  872.             } else if (split[0].equalsIgnoreCase("/banlist")) {
  873.                 byte type = 0;
  874.                 if (split.length == 2) {
  875.                     if (split[1].equalsIgnoreCase("ips")) {
  876.                         type = 1;
  877.                     }
  878.                 }
  879.                 if (type == 0) { //Regular user bans
  880.                     msg(Colors.Blue + "Ban list:" + Colors.White + " " + d.f.getBans());
  881.                 } else { //IP bans
  882.                     msg(Colors.Blue + "IP Ban list:" + Colors.White + " " + d.f.getBans());
  883.                 }
  884.             } else if (split[0].equalsIgnoreCase("/banip")) {
  885.                 if (split.length < 2) {
  886.                     msg(Colors.Rose + "Correct usage is: /banip [player] <reason> (optional) NOTE: this permabans IPs.");
  887.                     return;
  888.                 }
  889.  
  890.                 ea player = match(split[1]);
  891.  
  892.                 if (player != null) {
  893.                     if (!hasControlOver(player)) {
  894.                         msg(Colors.Rose + "You can't ban that user.");
  895.                         return;
  896.                     }
  897.  
  898.                     // adds player to ban list
  899.                     this.d.f.c(player.a.b.b().toString().split(":")[0].substring(1));
  900.  
  901.                     etc.getInstance().getLoader().callHook(PluginLoader.HOOKS.IPBAN, new Object[]{e, split.length > 2 ? split[1] : ""});
  902.  
  903.                     a.log(Level.INFO, "IP Banning " + player.aq + " (IP: " + player.a.b.b().toString() + ")");
  904.                     msg(Colors.Rose + "IP Banning " + player.aq + " (IP: " + player.a.b.b().toString() + ")");
  905.  
  906.                     if (split.length > 2) {
  907.                         player.a.c("IP Banned by " + e.aq + ": " + combineSplit(2, split, " "));
  908.                         String ipbanmessage = Colors.GMSG2 + player.aq + " was IP Banned by " + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG2 + ": ( " + combineSplit(2, split, " )");
  909.             this.d.f.a(new ba(ipbanmessage));
  910.                     } else {
  911.                         player.a.c("IP Banned by " + e.aq + ".");
  912.                         String ipbanmessage = Colors.GMSG2 + player.aq + " IP banned by " + etc.getInstance().getUserColor(e.aq) + e.aq;
  913.                         this.d.f.a(new ba(ipbanmessage));
  914.                     }
  915.                 } else {
  916.                     msg(Colors.Rose + "Can't find user " + split[1] + ".");
  917.                 }
  918.             } else if (split[0].equalsIgnoreCase("/ban")) {
  919.                 if (split.length < 2) {
  920.                     msg(Colors.Rose + "Correct usage is: /ban [player] <reason> (optional)");
  921.                     return;
  922.                 }
  923.  
  924.                 ea player = match(split[1]);
  925.  
  926.                 if (player != null) {
  927.                     if (!hasControlOver(player)) {
  928.                         msg(Colors.Rose + "You can't ban that user.");
  929.                         return;
  930.                     }
  931.  
  932.                     // adds player to ban list
  933.                     this.d.f.a(player.aq);
  934.  
  935.                     etc.getInstance().getLoader().callHook(PluginLoader.HOOKS.BAN, new Object[]{e, split.length > 2 ? split[1] : ""});
  936.  
  937.                     if (split.length > 2) {
  938.                         player.a.c("Banned by " + e.aq + ": " + combineSplit(2, split, " "));
  939.                         String banmessage = Colors.GMSG2 + player.aq + " Banned by " + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG2 + ": (" + combineSplit(2, split, " )");
  940.                         this.d.f.a(new ba(banmessage));
  941.                     } else {
  942.                         player.a.c("Banned by " + e.aq + ".");
  943.                         String banmessage = Colors.GMSG2 + player.aq + " Banned by " + etc.getInstance().getUserColor(e.aq) + this.e.aq;
  944.                         this.d.f.a(new ba(banmessage));
  945.                     }
  946.                     a.log(Level.INFO, "Banning " + player.aq);
  947.                     msg(Colors.Rose + "Banning " + player.aq);
  948.                 } else {
  949.                     msg(Colors.Rose + "Can't find user " + split[1] + ".");
  950.                 }
  951.             } else if (split[0].equalsIgnoreCase("/unban")) {
  952.                 if (split.length != 2) {
  953.                     msg(Colors.Rose + "Correct usage is: /unban [player]");
  954.                     return;
  955.                 }
  956.                 this.d.f.b(split[1]);
  957.                 msg(Colors.Rose + "Unbanned " + split[1]);
  958.             } else if (split[0].equalsIgnoreCase("/unbanip")) {
  959.                 if (split.length != 2) {
  960.                     msg(Colors.Rose + "Correct usage is: /unbanip [ip]");
  961.                     return;
  962.                 }
  963.                 this.d.f.d(split[1]);
  964.                 msg(Colors.Rose + "Unbanned " + split[1]);
  965.             } else if (split[0].equalsIgnoreCase("/kick")) {
  966.                 if (split.length < 2) {
  967.                     msg(Colors.Rose + "Correct usage is: /kick [player] <reason> (optional)");
  968.                     return;
  969.                 }
  970.  
  971.                 ea player = match(split[1]);
  972.  
  973.                 if (player != null) {
  974.                     if (!hasControlOver(player)) {
  975.                         msg(Colors.Rose + "You can't kick that user.");
  976.                         return;
  977.                     }
  978.  
  979.                     etc.getInstance().getLoader().callHook(PluginLoader.HOOKS.KICK, new Object[]{e, split.length > 2 ? split[1] : ""});
  980.  
  981.                     if (split.length > 2) {
  982.                         player.a.c("Kicked by " + e.aq + ": " + combineSplit(2, split, " "));
  983.                         String globalmessage = Colors.GMSG2 + player.aq + " was kicked by " + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG2 + ": ( " + combineSplit(2, split, " )");
  984.                         this.d.f.a(new ba(globalmessage));
  985.                     } else {
  986.                         player.a.c("Kicked by " + e.aq + ".");
  987.                         String globalmessage = Colors.GMSG2 + player.aq + " was kicked by " + etc.getInstance().getUserColor(e.aq) + this.e.aq;
  988.                         this.d.f.a(new ba(globalmessage));
  989.                     }
  990.                     a.log(Level.INFO, "Kicking " + player.aq);
  991.                     msg(Colors.Rose + "Kicking " + player.aq);
  992.                 } else {
  993.                     msg(Colors.Rose + "Can't find user " + split[1] + ".");
  994.                 }
  995.             } else if (split[0].equalsIgnoreCase("/me")) {
  996.                 if (etc.getInstance().isMuted(e)) {
  997.                     msg(Colors.Rose + "You are currently muted.");
  998.                     return;
  999.                 }
  1000.                 if (split.length == 1)
  1001.                     return;
  1002.                 String prefix = etc.getInstance().getUserColor(e.aq);
  1003.                 String paramString2 = "* " + prefix + this.e.aq + Colors.White + " " + paramString.substring(paramString.indexOf(" ")).trim();
  1004.                 a.info("* " + this.e.aq + " " + paramString.substring(paramString.indexOf(" ")).trim());
  1005.                 this.d.f.a(new ba(paramString2));
  1006.             } else if (split[0].equalsIgnoreCase("/sethome")) {
  1007.                 // player.k, player.l, player.m
  1008.                 // x, y, z
  1009.                 Location loc = new Location();
  1010.                 loc.x = e.l;
  1011.                 loc.y = e.m;
  1012.                 loc.z = e.n;
  1013.                 loc.rotX = e.r;
  1014.                 loc.rotY = e.s;
  1015.                 Warp home = new Warp();
  1016.                 home.Location = loc;
  1017.                 home.Group = ""; //no group neccessary, lol.
  1018.                 home.Name = e.aq;
  1019.                 etc.getInstance().changeHome(home);
  1020.                 msg(Colors.Rose + "Your home has been set.");
  1021.             } else if (split[0].equalsIgnoreCase("/spawn")) {
  1022.                 String spawnmsg = Colors.GMSG + etc.getInstance().getUserColor(e.aq) + e.aq + Colors.GMSG + " returned to spawn.";
  1023.         this.d.f.a(new ba(spawnmsg));
  1024.                 int m = this.d.e.d(this.d.e.n, this.d.e.p);
  1025.                 a(this.d.e.n + 0.5D, m + 1.5D, this.d.e.p + 0.5D, 0.0F, 0.0F);
  1026.             } else if (split[0].equalsIgnoreCase("/setspawn")) {
  1027.                 this.d.e.n = (int) Math.ceil(e.l);
  1028.                 //Too lazy to actually update this considering it's not even used anyways.
  1029.                 //this.d.e.n = (int) Math.ceil(e.m); //Not that the Y axis really matters since it tries to get the highest point iirc.
  1030.                 this.d.e.p = (int) Math.ceil(e.n);
  1031.                 a.info("Spawn position changed.");
  1032.                 String spawnchangemessage = Colors.GMSG +  etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.GMSG + " has changed spawn to his current position.";
  1033.         this.d.f.a(new ba(spawnchangemessage));
  1034.                 msg(Colors.Rose + "You have set the spawn to your current position.");
  1035.             } else if (split[0].equalsIgnoreCase("/home")) {
  1036.                 Warp home = null;
  1037.                 if (split.length > 1 && etc.getInstance().isAdmin(e)) {
  1038.                     home = etc.getInstance().getDataSource().getHome(split[1]);
  1039.                 } else {
  1040.                     home = etc.getInstance().getDataSource().getHome(e.aq);
  1041.                 }
  1042.  
  1043.                 if (home != null) {
  1044.                     a(home.Location.x, home.Location.y, home.Location.z, home.Location.rotX, home.Location.rotY);
  1045.                 } else if (split.length > 1 && etc.getInstance().isAdmin(e)) {
  1046.                     msg(Colors.Rose + "That player home does not exist");
  1047.                 } else {
  1048.                     int m = this.d.e.d(this.d.e.n, this.d.e.p);
  1049.                     a(this.d.e.n + 0.5D, m + 1.5D, this.d.e.p + 0.5D, 0.0F, 0.0F);
  1050.                 }
  1051.             } else if (split[0].equalsIgnoreCase("/warp")) {
  1052.                 if (split.length < 2) {
  1053.                     msg(Colors.Rose + "Correct usage is: /warp [warpname]");
  1054.                     return;
  1055.                 }
  1056.                 ea toWarp = e;
  1057.                 Warp warp = null;
  1058.                 if (split.length == 3 && etc.getInstance().canIgnoreRestrictions(e)) {
  1059.                     warp = etc.getInstance().getDataSource().getWarp(split[1]);
  1060.                     toWarp = match(split[2]);
  1061.                 } else {
  1062.                     warp = etc.getInstance().getDataSource().getWarp(split[1]);
  1063.                 }
  1064.                 if (toWarp != null) {
  1065.                     if (warp != null) {
  1066.                         if (!etc.getInstance().isUserInGroup(e, warp.Group) && !warp.Group.equals("")) {
  1067.                             msg(Colors.Rose + "Warp not found.");
  1068.                         } else {
  1069.                             toWarp.a.a(warp.Location.x, warp.Location.y, warp.Location.z, warp.Location.rotX, warp.Location.rotY);
  1070.                             toWarp.a.msg(Colors.Rose + "Woosh!");
  1071.                         }
  1072.                     } else {
  1073.                         msg(Colors.Rose + "Warp not found");
  1074.                     }
  1075.                 } else {
  1076.                     msg(Colors.Rose + "Player not found.");
  1077.                 }
  1078.             } else if (split[0].equalsIgnoreCase("/listwarps") && etc.getInstance().getDataSource().hasWarps()) {
  1079.                 if (split.length != 2 && split.length != 3) {
  1080.                     msg(Colors.Rose + "Available warps: " + Colors.White + etc.getInstance().getDataSource().getWarpNames(e.aq));
  1081.                     return;
  1082.                 }
  1083.             } else if (split[0].equalsIgnoreCase("/setwarp")) {
  1084.                 if (split.length < 2) {
  1085.                     if (etc.getInstance().canIgnoreRestrictions(e)) {
  1086.                         msg(Colors.Rose + "Correct usage is: /setwarp [warpname] [group]");
  1087.                     } else {
  1088.                         msg(Colors.Rose + "Correct usage is: /setwarp [warpname]");
  1089.                     }
  1090.                     return;
  1091.                 }
  1092.                 Location loc = new Location();
  1093.                 loc.x = e.l;
  1094.                 loc.y = e.m;
  1095.                 loc.z = e.n;
  1096.                 loc.rotX = e.r;
  1097.                 loc.rotY = e.s;
  1098.                 Warp warp = new Warp();
  1099.                 warp.Name = split[1];
  1100.                 warp.Location = loc;
  1101.                 if (split.length == 3) {
  1102.                     warp.Group = split[2];
  1103.                 } else {
  1104.                     warp.Group = "";
  1105.                 }
  1106.                 etc.getInstance().setWarp(warp);
  1107.                 msg(Colors.Rose + "Created warp point " + split[1] + ".");
  1108.             } else if (split[0].equalsIgnoreCase("/removewarp")) {
  1109.                 if (split.length < 2) {
  1110.                     msg(Colors.Rose + "Correct usage is: /removewarp [warpname]");
  1111.                     return;
  1112.                 }
  1113.                 Warp warp = etc.getInstance().getDataSource().getWarp(split[1]);
  1114.                 if (warp != null) {
  1115.                     etc.getInstance().getDataSource().removeWarp(warp);
  1116.                     msg(Colors.Blue + "Warp removed.");
  1117.                 } else {
  1118.                     msg(Colors.Rose + "That warp does not exist");
  1119.                 }
  1120.             } else if (split[0].equalsIgnoreCase("/lighter")) {
  1121.                 if (MinecraftServer.b.containsKey(this.e.aq + " lighter")) {
  1122.                     a.info(this.e.aq + " failed to iron!");
  1123.                     msg(Colors.Rose + "You can't create another lighter again so soon");
  1124.                 } else {
  1125.                     if (!etc.getInstance().canIgnoreRestrictions(e)) {
  1126.                         MinecraftServer.b.put(this.e.aq + " lighter", Integer.valueOf(6000));
  1127.                     }
  1128.                     a.info(this.e.aq + " created a lighter!");
  1129.                     this.e.a(new gp(259, 1));
  1130.                 }
  1131.             } else if ((paramString.startsWith("/#")) && (this.d.f.g(this.e.aq))) {
  1132.                 String str = paramString.substring(2);
  1133.                 a.info(this.e.aq + " issued server command: " + str);
  1134.                 this.d.a(str, this);
  1135.             } else if (split[0].equalsIgnoreCase("/time")) {
  1136.                 if (split.length != 2) {
  1137.                     msg(Colors.Rose + "Correct usage is: /time [time|day|night]");
  1138.                     return;
  1139.                 }
  1140.  
  1141.                 if (split[1].equalsIgnoreCase("day")) {
  1142.                     String timeday = Colors.GMSG + "Daylight breaks thanks to " + etc.getInstance().getUserColor(e.aq) + e.aq;
  1143.                     this.d.f.a(new ba(timeday));
  1144.                     this.d.e.c = 0;
  1145.                 } else if (split[1].equalsIgnoreCase("night")) {
  1146.                     String timenight = Colors.GMSG + "What a terrible night to have a curse (" + etc.getInstance().getUserColor(e.aq) + e.aq + Colors.GMSG + ")";
  1147.                     this.d.f.a(new ba(timenight));
  1148.                     this.d.e.c = 13000;
  1149.                 } else {
  1150.                     try {
  1151.                         this.d.e.c = Long.parseLong(split[1]);
  1152.                     } catch (NumberFormatException e) {
  1153.                         msg(Colors.Rose + "Please enter numbers, not letters.");
  1154.                     }
  1155.                 }
  1156.             } else if (split[0].equalsIgnoreCase("/getpos")) {
  1157.                 msg("Pos X: " + e.l + " Y: " + e.m + " Z " + e.n);
  1158.                 msg("Rotation X: " + e.r + " Y: " + e.s);
  1159.  
  1160.                 double degreeRotation = ((e.r - 90) % 360);
  1161.                 if (degreeRotation < 0) {
  1162.                     degreeRotation += 360.0;
  1163.                 }
  1164.                 msg("Compass: " + etc.getCompassPointForDirection(degreeRotation) + " (" + (Math.round(degreeRotation * 10) / 10.0) + ")");
  1165.             } else if (split[0].equalsIgnoreCase("/compass")) {
  1166.                 double degreeRotation = ((e.r - 90) % 360);
  1167.                 if (degreeRotation < 0) {
  1168.                     degreeRotation += 360.0;
  1169.                 }
  1170.  
  1171.                 msg(Colors.Rose + "Compass: " + etc.getCompassPointForDirection(degreeRotation));
  1172.             } else if (split[0].equalsIgnoreCase("/motd")) {
  1173.                 for (String str : etc.getInstance().motd) {
  1174.                     msg(str);
  1175.                 }
  1176.             } else if (split[0].equalsIgnoreCase("/fabulous"))
  1177.             {
  1178.                 if (split.length == 1)
  1179.                 return;
  1180.                 String temp = "";
  1181.                 String str = "";
  1182.  
  1183.                 str = paramString.substring(paramString.indexOf(" ")).trim();
  1184.  
  1185.                 String[] rainbow = new String[] {Colors.Red, Colors.Rose, Colors.Yellow, Colors.Green, Colors.Blue, Colors.LightPurple, Colors.Purple};
  1186.                 int counter=0;
  1187.                 for(int x=0; x<str.length(); x++)
  1188.                 {
  1189.                     temp+=rainbow[counter]+str.charAt(x);
  1190.                     counter++;
  1191.                     if(counter==7){counter = 0; }
  1192.                 }
  1193.                 str = temp+" ";
  1194.                 String message = "<" + etc.getInstance().getUserColor(e.aq) + this.e.aq + Colors.White + "> " + str;
  1195.                 a.log(Level.INFO, "<" + e.aq + "> Fabulously said: " + str);
  1196.                 this.d.f.a(new ba(message));
  1197.             }
  1198.              else {
  1199.                 a.info(this.e.aq + " tried command " + paramString);
  1200.                 msg(Colors.Rose + "Unknown command");
  1201.             }
  1202.         } catch (Exception ex) {
  1203.             a.log(Level.SEVERE, "Exception in command handler (Report this to hey0 unless you did something dumb like enter letters as numbers):", ex);
  1204.             if (etc.getInstance().isAdmin(e)) {
  1205.                 msg(Colors.Rose + "Exception occured. Check the server for more info.");
  1206.             }
  1207.         }
  1208.     }
  1209.  
  1210.     public void a(o paramo) {
  1211.         if (paramo.b == 1) {
  1212.             this.e.z();
  1213.         }
  1214.     }
  1215.  
  1216.     public void a(io paramio) {
  1217.         this.b.a("Quitting");
  1218.     }
  1219.  
  1220.     public int b() {
  1221.         return this.b.d();
  1222.     }
  1223.  
  1224.     public void b(String paramString) {
  1225.         b(new ba("ยง7" + paramString));
  1226.     }
  1227.  
  1228.     public String c() {
  1229.         return this.e.aq;
  1230.     }
  1231.  
  1232.     public void a(r paramr) {
  1233.         if (paramr.a == -1) {
  1234.             this.e.aj.a = paramr.b;
  1235.         }
  1236.         if (paramr.a == -2) {
  1237.             this.e.aj.c = paramr.b;
  1238.         }
  1239.         if (paramr.a == -3) {
  1240.             this.e.aj.b = paramr.b;
  1241.         }
  1242.     }
  1243.  
  1244.     public void d() {
  1245.         this.b.a(new r(-1, this.e.aj.a));
  1246.         this.b.a(new r(-2, this.e.aj.c));
  1247.         this.b.a(new r(-3, this.e.aj.b));
  1248.     }
  1249.  
  1250.     public void a(ib paramib) {
  1251.         as localas = this.d.e.k(paramib.a, paramib.b, paramib.c);
  1252.         if (localas != null) {
  1253.             localas.a(paramib.e);
  1254.             localas.c();
  1255.         }
  1256.     }
  1257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement