Advertisement
Guest User

Untitled

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