diff --git a/imagedownloaderutil_1.png b/imagedownloaderutil_1.png deleted file mode 100644 index 860accb..0000000 Binary files a/imagedownloaderutil_1.png and /dev/null differ diff --git a/src/commands/general/CommandBlurry.java b/src/commands/general/CommandBlurry.java index 05e0e16..53e9bf8 100644 --- a/src/commands/general/CommandBlurry.java +++ b/src/commands/general/CommandBlurry.java @@ -73,14 +73,18 @@ public class CommandBlurry extends Command { BufferedImage blurred = ImageUtils.copyImage(image); // Iterate over each column left to right and touch up each pixel - for(int x = 0; x < image.getWidth(); ++x) + for(int i = 0; i < 10; i++) { - for(int y = 0; y < image.getHeight(); ++y) + for(int x = 0; x < image.getWidth(); ++x) { - blurred.setRGB(x, y, getColorAvg(image, x, y).getRGB()); + for(int y = 0; y < image.getHeight(); ++y) + { + blurred.setRGB(x, y, getColorAvg(image, x, y).getRGB()); + } } + image = blurred; } - image = ImageUtils.copyImage(blurred); + File outputfile = new File(name); ImageIO.write(blurred, "png", outputfile); @@ -93,12 +97,16 @@ public class CommandBlurry extends Command float g = 0; float b = 0; - for(int xCor = -2; xCor <= 2; xCor++) { for(int yCor = -2; yCor <= 2; yCor++) { - current = new Color(image.getRGB(clamp(x + xCor, 0, image.getWidth() - 1), clamp(y + yCor, 0, image.getHeight() - 1))); + int curX = clamp(x + xCor, 0, image.getWidth() - 1); + int curY = clamp(y + yCor, 0, image.getHeight() - 1); + + + current = new Color(image.getRGB(curX, curY)); + r += getGaus(current.getRed(), xCor, yCor); g += getGaus(current.getGreen(), xCor, yCor); b += getGaus(current.getBlue(), xCor, yCor); diff --git a/src/commands/general/CommandRoll.java b/src/commands/general/CommandRoll.java index 10bbee8..498ebe8 100644 --- a/src/commands/general/CommandRoll.java +++ b/src/commands/general/CommandRoll.java @@ -151,7 +151,6 @@ public class CommandRoll extends Command break; case 'd': rolls = roll(first, second); - System.out.println(first); for(int i= 0; i < first; i++) { value += rolls[i]; @@ -177,7 +176,7 @@ public class CommandRoll extends Command int [] rolls = new int [sides]; if(dice < 1) - return new int[0]; + return new int[0]; for(int i = 0; dice > i; i ++) { roll = (int)(Math.random() * sides) + 1; diff --git a/src/commands/guildrole/SubCommandAdd.java b/src/commands/guildrole/SubCommandAdd.java index 04bf090..3555fe9 100644 --- a/src/commands/guildrole/SubCommandAdd.java +++ b/src/commands/guildrole/SubCommandAdd.java @@ -16,22 +16,29 @@ public class SubCommandAdd extends SubCommand @Override public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input) { - String role = input.args.split(" ")[0]; - if(guild.roleList.contains(role)) + String [] roles = input.args.split(","); + String role; + String formatted = ""; + for(int i = 0; i < roles.length; i++) { - if(guild.control.addRole(user.discordID, role)) + role = roles[i].trim(); + if(guild.roleList.contains(role)) { - return new SubCommandFormattable("ADDED RIN YOU NEED TO FIX THIS"); + if(guild.control.addRole(user.discordID, role)) + { + formatted += "Addded " + role + "!"; + } + else + { + formatted += "Failed to add " + role + "!"; + } } else { - return new SubCommandFormattable("FAILED RIN YOU NEED TO FIX THIS TOO"); + formatted += "You're not allowed to add " + role + "!"; } } - else - { - return new SubCommandFormattable("NOT ALLOWED FIX THIS ONE TOO SNEP FACE"); - } + return new SubCommandFormattable(formatted); } } \ No newline at end of file diff --git a/src/commands/guildrole/SubCommandNotAllowed.java b/src/commands/guildrole/SubCommandNotAllowed.java index e2c6ac7..8803fde 100644 --- a/src/commands/guildrole/SubCommandNotAllowed.java +++ b/src/commands/guildrole/SubCommandNotAllowed.java @@ -19,18 +19,25 @@ public class SubCommandNotAllowed extends SubCommand { String lowerInput = input.args.toLowerCase(); String [] roles = lowerInput.split(","); + String formatted = ""; + + if(roles.length < 1) + { + return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedNoArgs"))); + } + for(String role:roles) { if(guild.roleList.contains(role.trim())) { guild.roleList.remove(role); - return new SubCommandFormattable(LocStrings.stub("GuildRoleNotAllowedSuccess")); + formatted += String.format(LocStrings.stub("GuildRoleNotAllowedSuccess"), role); } else { - return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role)); + formatted += String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role); } } - return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedNoArgs"))); + return new SubCommandFormattable(formatted); } } \ No newline at end of file