From 886d7f41924616b659bcf824cc2dc9a7f227cee4 Mon Sep 17 00:00:00 2001 From: Gibstick Date: Fri, 19 Jul 2013 19:32:26 -0400 Subject: [PATCH] refactorizations, fixed /ds other, added permission for -p switch --- dist/DiscoSheep.jar | Bin 31770 -> 31134 bytes .../bukkit/discosheep/DiscoParty.java | 18 +++-- .../bukkit/discosheep/DiscoSheep.java | 22 +++--- .../discosheep/DiscoSheepCommandExecutor.java | 68 ++++++++++-------- src/plugin.yml | 7 +- 5 files changed, 69 insertions(+), 46 deletions(-) diff --git a/dist/DiscoSheep.jar b/dist/DiscoSheep.jar index 5e1b1b7016ec45362182d39ff0aa1f2b8cdb739d..c444cbb31dcf080299924212e7427eb7d86a1f1e 100644 GIT binary patch delta 10026 zcma)C34D~*wf~>VOujEOUsjTkAwa?olLZJ6NZ1k}K!Aj>hOiGLKu91V37dc;ilVim z@TnEFE@+E=#a4+7q_n8d)>f^pwTrdYs%>p+H=nhwR;#}M`MxYe-|PFm;m7&T-OfGt z+;h)4_uQQNK<<4{teS;!UO!+0)psAa#(1jker&QOp6a{p3K^lFX35vjDVfYq=MUwz zgrw@b-%AhTq)f;oOnmI?)Pwe!6AGPu9^vVR1j9MNx^0X^$HpkY)L?5yKGf-n}S9K+Z8k^XjZU8 z7rawJOZ?0?+;wTGH9>Ysn=Zdyu?_{h73}fOWG_SZ`q4mUWuNR1V82|Y#RG;M)WL`R z_*kyinn*;^YZM&z%e8WyVn-BQACMd5sDc}H{7t&V*$O_RdvvoQpH)h?C^)9zRt2{y zIBv)ZKO$nQkZxD(4z0e^FQ1dUl;e{DIVE>%-94r@f1c&eo0HbXXB-qH?QX3PcQlkY zH!s`P(9lXX==?anNQ_aOk*l(cGv6F-;UU~_;XValQ1F0)FDf{#;EaL?ald`MZL~eJ zzm@nMJZs^31>eQ9oz4B<^>pqUFgHQc?2E%*Ncbw^_z$SCb4Cm+4CS9kLg*a)=Mmt? zI*&wtlFlQUpOo`ReT-c__!?mmEc@x0G~rlSmVP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ndcj|$&8XDx!$bg;x}rr!c+9cM7FN{!=I`3gkS4{Nu3H#*{>Qi=tAz=e+lF=e!XU6=?6mNuk}WZbQK9DGm2P{*K+joj%j|)cIS-%3T>Vjk=QJuyEN@YCVl<~Y zAzdln#OR6f^PH~3c_QXJiWHq^ac zHNBvgoRr}uF?Q9a(UaMA+5hQ^I`&-d_Qb0tF*$weR!>bkg%$Qan-YT@d6hGAAtxcj zeG?t*!O9-2B8Al<3O9sNSVIch`xMspprHrr;+KYLZ$yauMu+hHFz(Srg3Td<6G<@G z$J2U;rwu)*jo;{?Es9=Fb$_&+{QNKlc{lbto3qK8U~qO$qCe53(G4UTr?J`Hj#lSe zif&v&c1mP;k1cMGt?Usz&Syog*?Ssomr-edxKCUmBfagi1x7qfuW_Dt*Y9Bw?@|k7 zBFjdG%llbAAur3TyuNfim3Vjp!DoyJh7wT>CVY$lVi*Gqrk73*(krLazmB3)%%+#g zqZ=xuWi98)nN7b_$0NInhqi?WwvDEI50C3!nz|#jOUHSzALIdjj6bgVE}zSv9zTBLiNiadH2l_+ zi+4TK@t&s|zw@lX?>*b_N6#&I-*bc)_G*v#;~O$Gl2O=`h~f0af)08kf9m5lzD5Z+ z7_))hPC!GO>p9wIkcfo>RbuD3KAL%APdl-pVj4Mm8Ta0bXDGEuM0pNVF6z#Go`aN$ z+M^iHK75}x%EVw#@LImgt2a#c?Bd(JTEcWsCm(Fo5+30y`3oxAPK^aBk$8#RxhCw4 zf#+$O9Anh$*fN^2`~-1Y(xLN7G^R=29qnx%`@;4>_qfh)d17kjizgw%uTeUG)M!`kDCVyk z?fpB-^>>WV?U<~^XFIOYV%p9*TI}E1_%AvSo%)x^WpY9N T{~p-8tJA(_cUsixUE21)@IE<~ diff --git a/src/gibstick/bukkit/discosheep/DiscoParty.java b/src/gibstick/bukkit/discosheep/DiscoParty.java index 345d4be..6929477 100644 --- a/src/gibstick/bukkit/discosheep/DiscoParty.java +++ b/src/gibstick/bukkit/discosheep/DiscoParty.java @@ -58,10 +58,18 @@ public class DiscoParty { public DiscoParty(DiscoSheep parent, Player player) { this.ds = parent; this.player = player; + this.duration = DiscoParty.defaultDuration; + this.period = DiscoParty.defaultPeriod; + this.radius = DiscoParty.defaultRadius; + this.sheep = DiscoParty.defaultSheep; } - + public DiscoParty(DiscoSheep parent) { this.ds = parent; + this.duration = DiscoParty.defaultDuration; + this.period = DiscoParty.defaultPeriod; + this.radius = DiscoParty.defaultRadius; + this.sheep = DiscoParty.defaultSheep; } // copy but with new player @@ -76,10 +84,10 @@ public class DiscoParty { newParty.setDuration(this.duration); newParty.setPeriod(this.period); newParty.setRadius(this.radius); - newParty.setSheep(this.sheep); - return newParty; + newParty.setSheep(this.sheep); + return newParty; } - + List getSheep() { return sheepList; } @@ -332,7 +340,7 @@ public class DiscoParty { this.scheduleUpdate(); ds.getPartyMap().put(this.player.getName(), this); } - + void startDisco() { this.spawnSheep(sheep, radius); this.scheduleUpdate(); diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 151e081..a8fdc1b 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -108,15 +108,15 @@ public final class DiscoSheep extends JavaPlugin { } } - public void startParty(Player player, int duration, int sheepAmount, int radius, int period, boolean fireworksEnabled) { - if (!hasParty(player.getName())) { - DiscoParty ds = new DiscoParty(this, player); - ds.setDuration(duration); - ds.setSheep(sheepAmount); - ds.setRadius(radius); - ds.setPeriod(period); - ds.setDoFireworks(fireworksEnabled); - ds.startDisco(); - } - } + /*public void startParty(Player player, int duration, int sheepAmount, int radius, int period, boolean fireworksEnabled) { + * if (!hasParty(player.getName())) { + * DiscoParty ds = new DiscoParty(this, player); + * ds.setDuration(duration); + * ds.setSheep(sheepAmount); + * ds.setRadius(radius); + * ds.setPeriod(period); + * ds.setDoFireworks(fireworksEnabled); + * ds.startDisco(); + * } + * }*/ } diff --git a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java index df3cc46..1a198da 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java @@ -21,6 +21,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { private static final String PERMISSION_STOPALL = "discosheep.stopall"; private static final String PERMISSION_RELOAD = "discosheep.reload"; private static final String PERMISSION_OTHER = "discosheep.partyother"; + private static final String PERMISSION_CHANGEPERIOD = "discosheep.changeperiod"; //private static final String DELIM = "[ ]+"; private boolean senderHasPerm(CommandSender sender, String permission) { @@ -60,8 +61,8 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { // extract a list of players from a list of arguments private String[] parsePlayerList(String[] args, int i) { int j = i; - while (j < args.length && !args[i].startsWith("-")) { - ++j; + while (j < args.length && !args[j].startsWith("-")) { + j++; } return Arrays.copyOfRange(args, i, j); } @@ -94,20 +95,28 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } } - private boolean partyCommand(CommandSender sender, int _duration, int _sheepNumber, int _radius, int _period, boolean _fireworks) { - if (senderHasPerm(sender, PERMISSION_PARTY)) { - parent.startParty((Player) sender, _duration, _sheepNumber, _radius, _period, _fireworks); + private boolean partyCommand(Player player, DiscoParty party) { + if (senderHasPerm(player, PERMISSION_PARTY)) { + if (!parent.hasParty(player.getName())) { + party.setPlayer(player); + party.startDisco(); + } else { + player.sendMessage("You already have a party. Are you underground?"); + } return true; } else { - return noPermsMessage(sender, PERMISSION_PARTY); + return noPermsMessage(player, PERMISSION_PARTY); } } - private boolean partyAllCommand(CommandSender sender, int _duration, int _sheepNumber, int _radius, int _period, boolean _fireworks) { + private boolean partyAllCommand(CommandSender sender, DiscoParty party) { if (senderHasPerm(sender, PERMISSION_ALL)) { for (Player p : Bukkit.getServer().getOnlinePlayers()) { - parent.startParty(p, _duration, _sheepNumber, _radius, _period, _fireworks); - p.sendMessage(ChatColor.RED + "LET'S DISCO!"); + if (!parent.hasParty(p.getName())) { + DiscoParty individualParty = party.DiscoParty(p); + individualParty.startDisco(); + p.sendMessage(ChatColor.RED + "LET'S DISCO!"); + } } return true; } else { @@ -129,13 +138,16 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { return true; } - private boolean partySelectCommand(String[] players, CommandSender sender, int _duration, int _sheepNumber, int _radius, int _period, boolean _fireworks) { + private boolean partyOtherCommand(String[] players, CommandSender sender, DiscoParty party) { if (senderHasPerm(sender, PERMISSION_OTHER)) { Player p; for (String playerName : players) { p = Bukkit.getServer().getPlayer(playerName); if (p != null) { - parent.startParty(p, _duration, _sheepNumber, _radius, _period, _fireworks); + if (!parent.hasParty(p.getName())) { + DiscoParty individualParty = party.DiscoParty(p); + individualParty.startDisco(); + } } else { sender.sendMessage("Invalid player: " + playerName); } @@ -151,11 +163,6 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { Player player = null; boolean isPlayer = false; - boolean fireworks = false; - int sheepNumber = DiscoParty.defaultSheep; - int radius = DiscoParty.defaultRadius; - int duration = DiscoParty.defaultDuration; - int period = DiscoParty.defaultPeriod; if (sender instanceof Player) { player = (Player) sender; @@ -175,19 +182,19 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } } - DiscoParty mainParty = new DiscoParty(parent); + DiscoParty parentParty = new DiscoParty(parent); for (int i = 1; i < args.length; i++) { if (args[i].equalsIgnoreCase("-fw")) { if (senderHasPerm(sender, PERMISSION_FIREWORKS)) { - mainParty.setDoFireworks(true); + parentParty.setDoFireworks(true); } else { return noPermsMessage(sender, PERMISSION_FIREWORKS); } } else if (args[i].equalsIgnoreCase("-r")) { try { - mainParty.setRadius(parseNextIntArg(args, i)); - sender.sendMessage("RADIUS OK"); + parentParty.setRadius(parseNextIntArg(args, i)); + //sender.sendMessage("RADIUS OK"); } catch (IllegalArgumentException e) { sender.sendMessage("Radius must be an integer within the range [1, " + DiscoParty.maxRadius + "]"); @@ -195,8 +202,8 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } } else if (args[i].equalsIgnoreCase("-n")) { try { - mainParty.setSheep(parseNextIntArg(args, i)); - sender.sendMessage("SHEEP OK"); + parentParty.setSheep(parseNextIntArg(args, i)); + //sender.sendMessage("SHEEP OK"); } catch (IllegalArgumentException e) { sender.sendMessage("The number of sheep must be an integer within the range [1, " + DiscoParty.maxSheep + "]"); @@ -204,17 +211,20 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } } else if (args[i].equalsIgnoreCase("-t")) { try { - mainParty.setDuration(parent.toTicks(parseNextIntArg(args, i))); - sender.sendMessage("DURATION OK"); + parentParty.setDuration(parent.toTicks(parseNextIntArg(args, i))); + //sender.sendMessage("DURATION OK"); } catch (IllegalArgumentException e) { sender.sendMessage("The duration in seconds must be an integer within the range [1, " + parent.toSeconds(DiscoParty.maxDuration) + "]"); return false; } } else if (args[i].equalsIgnoreCase("-p")) { + if (!senderHasPerm(sender, PERMISSION_CHANGEPERIOD)) { + return noPermsMessage(sender, PERMISSION_CHANGEPERIOD); + } try { - mainParty.setPeriod(parseNextIntArg(args, i)); - sender.sendMessage("PERIOD OK"); + parentParty.setPeriod(parseNextIntArg(args, i)); + //sender.sendMessage("PERIOD OK"); } catch (IllegalArgumentException e) { sender.sendMessage( "The period in ticks must be within the range [" @@ -227,11 +237,11 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { if (args.length > 0) { if (args[0].equalsIgnoreCase("all")) { - return partyAllCommand(sender, duration, sheepNumber, radius, period, fireworks); + return partyAllCommand(sender, parentParty); } else if (args[0].equalsIgnoreCase("me") && isPlayer) { - return partyCommand(player, duration, sheepNumber, radius, period, fireworks); + return partyCommand(player, parentParty); } else if (args[0].equalsIgnoreCase("other")) { - return partySelectCommand(parsePlayerList(args, 1), sender, duration, sheepNumber, radius, period, fireworks); + return partyOtherCommand(parsePlayerList(args, 1), sender, parentParty); } else { sender.sendMessage(ChatColor.RED + "Invalid argument (certain commands do not work from console)."); return false; diff --git a/src/plugin.yml b/src/plugin.yml index f2eace4..4ddd2c4 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -19,6 +19,8 @@ permissions: discosheep.fireworks: true discosheep.stopall: true discosheep.reload: true + discosheep.other: true + discosheep.period: true discosheep.party: description: Allows a player to have a party of one default: op @@ -38,4 +40,7 @@ permissions: description: Allows a player to call parties for other people, including themselves. default: op children: - discosheep.party: true \ No newline at end of file + discosheep.party: true + discosheep.changeperiod: + description: Allows a player to use the -p switch + default: op \ No newline at end of file