From 0830764cc338d18dd84ac525cd0d5df61e194799 Mon Sep 17 00:00:00 2001 From: Gibstick Date: Fri, 19 Jul 2013 12:06:26 -0400 Subject: [PATCH] exceptions, y u no work --- dist/DiscoSheep.jar | Bin 30772 -> 31668 bytes .../bukkit/discosheep/DiscoParty.java | 4 ++ .../discosheep/DiscoSheepCommandExecutor.java | 45 ++++++++---------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dist/DiscoSheep.jar b/dist/DiscoSheep.jar index 7a80a48551a7322efcb8cd9285a9769548d7ccb1..1e6b4e032acf807f2f6460c236d1aeff5669f48c 100644 GIT binary patch delta 10326 zcmai433yc1^*`s$WZuin%f4?c2@sehY(hc+N!Zt5AV`R^1rkC?NFWP{C?g1>QV@OB z0=5*FnyOeefe8VZTB~)dR;^n_#RYd;mDUAO{=akIWHPvX|9sz^d+zeicF#F?%c0Nt z(AR91&U854LaR0aw0&uCw^n{MJHos-?9aZ)(BIYmIKfHVQ=0x|^j(z&-AWgh{3r6p6aEW!E- z)?cszf@KRfP_RKdd)<^^lg`mO*GV`>^LV^~2{L%1tC;LRS8;gX@8(U)OP1zI0wxRTDLPM; z(bI(1bPxN+@(d5pm&nH(-1I$PDlHp<`S>!aU+(5j z>=Wz?0h>L%g|8H_RleUQDi#U2O6F+0&Q}YiYXn>?V26NT3D~LgE;nuD>%>UA1-o9F zZ*a54zZQva^zcpm8)@4kz2$qQzE4KqEa0~SekWkR&c6?*Yx#hHTLj!H;5Grb3;2V8 zI|Q@|_@jV31>B|c-5m!b@7JtHwY(_zq}t}?jir@MEgP674zx-qrdcn?3<@_Is@JPl z>*AQj9cN?qFdww`#1-*9)~j*%BwWH2*}A5xvZZ=_eSO)=>gqLcN^4*IPX3cMFyZ#- z-Y^0Tt@EFBzE|fk>v+N~j!t^d+B`Nn{bu^DN%zuyCfzTfoer4v8`@*iUfO5zqAcsa z*s$Ryb{h{^5$ra>{!UL?hZ3_KchLdst;Fp9_ekTP z1RNA_HyzOVK9ld~cAX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~MdVwI(BNZMa&0?hQJCUI z7G)>cHqld}Ar@0FgD*0Lxi3Dts3>7MH?UB(F=077#wG6tlCD~#YbC7&Ho8_y($ij}YbMiOz-jOuClA}i?@eU02Ez*)FO|dzc{}Te z4kte{ahLnh)UPZ@kb9gy!7JWLZ&PJ)Kfky>;qB+D24kHJ@i|W{2}QgWcF@lC9=b_Z z=6Zv6-}Di!=&%DNq0;n``_Pl+kD$3Tc6F{W_sZDlgYfjda%%L2QSJ*vS$_@M`!Kp9 zIhgF-jX;p6%G38qR_OtFd7Jm8k7<|JATz-wGm%Glqg|wJt(aKh5Bgnl{$^C}!G;*Qh%bE->FI2av*yDB zPl9+S$e!(zJ+qx;MIgxX;uO`BZPgz1iOV*LBRxmjj2%7saou=WlbKPgjq0)V*j*iT5M^b_;M7hH=qrX0X6wrq@x&=vs0U zz0;$6r^nqpUq^*Ae`#st77Sw4j^P30EJomYjFv^*VOR6p>IORIRs1se2i67dW_j@- zFH29by!aB!i(j$4_zmvo?fxLs_ybam2W0{tmP$M-Gw>L1Ax}sXo|GH#jO@lOvKP)L~zSZvcLrk^qy?8I8!eO58ug}ppOTtIbhU^pfj zktS-TIXc-`!3!YEP)IQvsHJAx45Oa9YPQWW=J8XeW|=}`Hg(_1Os#2eD6)?;VMmj~ zohA-2*xl@Kmzy1!7<8j68NusBahKvQ;hsIhN8sy{mer+eT3P{PKjVHvstn_AQI z+YJ3*Mx7dm`}98@%~>;;{~^iQxn_j+-dr<4n~b%mX><14Gql;ccK(n5KT=@b1buSu zx&rU){yc~6p3~i#RFM>(JVA_1k3aUGoqlv3q%`e+dp15g!Fg`oI3<$1zQFs>1`^@d zcW3VU^ig_`JT?20=dzhG^+$5?zdakTUB=C DiscoParty.maxRadius) { + try { + mainParty.setRadius(parseNextIntArg(args, i)); + } catch (IllegalArgumentException e) { sender.sendMessage("Radius must be an integer within the range [1, " + DiscoParty.maxRadius + "]"); - return true; + return false; } } else if (args[i].equalsIgnoreCase("-n")) { - sheepNumber = parseNextIntArg(args, i); - - if (sheepNumber < 1 || sheepNumber > DiscoParty.maxSheep) { + try { + mainParty.setSheep(parseNextIntArg(args, i)); + } catch (IllegalArgumentException e) { sender.sendMessage("The number of sheep must be an integer within the range [1, " + DiscoParty.maxSheep + "]"); - return true; + return false; } } else if (args[i].equalsIgnoreCase("-t")) { - duration = parent.toTicks(parseNextIntArg(args, i)); - - if (duration < 1 || duration > DiscoParty.maxDuration) { + try { + mainParty.setDuration(parent.toTicks(parseNextIntArg(args, i))); + } catch (IllegalArgumentException e) { sender.sendMessage("The duration in seconds must be an integer within the range [1, " + parent.toSeconds(DiscoParty.maxDuration) + "]"); - return true; + return false; } } else if (args[i].equalsIgnoreCase("-p")) { - period = parseNextIntArg(args, i); - - if (period < DiscoParty.minPeriod || period > DiscoParty.maxPeriod) { + try { + mainParty.setPeriod(parseNextIntArg(args, i)); + } catch (IllegalArgumentException e) { sender.sendMessage( "The period in ticks must be within the range [" + DiscoParty.minPeriod + ", " + DiscoParty.maxPeriod + "]"); - return true; + return false; } } } if (args.length > 0) { - if (args[0].equalsIgnoreCase("all")) { return partyAllCommand(sender, duration, sheepNumber, radius, period, fireworks); } else if (args[0].equalsIgnoreCase("me") && isPlayer) { @@ -234,7 +232,6 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { sender.sendMessage(ChatColor.RED + "Invalid argument (certain commands do not work from console)."); return false; } - } return false;