diff --git a/dist/DiscoSheep.jar b/dist/DiscoSheep.jar index 5fb5588..5e1b1b7 100644 Binary files a/dist/DiscoSheep.jar and b/dist/DiscoSheep.jar differ diff --git a/src/gibstick/bukkit/discosheep/DiscoParty.java b/src/gibstick/bukkit/discosheep/DiscoParty.java index 5ef8a82..345d4be 100644 --- a/src/gibstick/bukkit/discosheep/DiscoParty.java +++ b/src/gibstick/bukkit/discosheep/DiscoParty.java @@ -94,7 +94,7 @@ public class DiscoParty { } public DiscoParty setDuration(int duration) throws IllegalArgumentException { - if (duration <= DiscoParty.maxDuration || duration > 0) { + if (duration <= DiscoParty.maxDuration && duration > 0) { this.duration = duration; return this; } else { @@ -103,7 +103,7 @@ public class DiscoParty { } public DiscoParty setPeriod(int period) throws IllegalArgumentException { - if (period >= DiscoParty.minPeriod || period <= DiscoParty.maxPeriod) { + if (period >= DiscoParty.minPeriod && period <= DiscoParty.maxPeriod) { this.period = period; return this; } else { @@ -112,7 +112,7 @@ public class DiscoParty { } public DiscoParty setRadius(int radius) throws IllegalArgumentException { - if (radius <= DiscoParty.maxRadius || radius > 0) { + if (radius <= DiscoParty.maxRadius && radius > 0) { this.radius = radius; return this; } else { @@ -121,7 +121,7 @@ public class DiscoParty { } public DiscoParty setSheep(int sheep) throws IllegalArgumentException { - if (sheep <= DiscoParty.maxSheep || sheep > 0) { + if (sheep <= DiscoParty.maxSheep && sheep > 0) { this.sheep = sheep; return this; } else { diff --git a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java index 510bece..df3cc46 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java @@ -187,6 +187,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } else if (args[i].equalsIgnoreCase("-r")) { try { mainParty.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,6 +196,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } else if (args[i].equalsIgnoreCase("-n")) { try { mainParty.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 + "]"); @@ -203,6 +205,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } else if (args[i].equalsIgnoreCase("-t")) { try { mainParty.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) + "]"); @@ -211,6 +214,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { } else if (args[i].equalsIgnoreCase("-p")) { try { mainParty.setPeriod(parseNextIntArg(args, i)); + sender.sendMessage("PERIOD OK"); } catch (IllegalArgumentException e) { sender.sendMessage( "The period in ticks must be within the range ["