=Bug Fixes

This commit is contained in:
Alex Stewart
2019-07-28 15:18:08 -07:00
parent 3af46e94da
commit 9cc703ab63
5 changed files with 41 additions and 20 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

+11 -3
View File
@@ -73,6 +73,8 @@ public class CommandBlurry extends Command
{ {
BufferedImage blurred = ImageUtils.copyImage(image); BufferedImage blurred = ImageUtils.copyImage(image);
// Iterate over each column left to right and touch up each pixel // Iterate over each column left to right and touch up each pixel
for(int i = 0; i < 10; i++)
{
for(int x = 0; x < image.getWidth(); ++x) for(int x = 0; x < image.getWidth(); ++x)
{ {
for(int y = 0; y < image.getHeight(); ++y) for(int y = 0; y < image.getHeight(); ++y)
@@ -80,7 +82,9 @@ public class CommandBlurry extends Command
blurred.setRGB(x, y, getColorAvg(image, x, y).getRGB()); blurred.setRGB(x, y, getColorAvg(image, x, y).getRGB());
} }
} }
image = ImageUtils.copyImage(blurred); image = blurred;
}
File outputfile = new File(name); File outputfile = new File(name);
ImageIO.write(blurred, "png", outputfile); ImageIO.write(blurred, "png", outputfile);
@@ -93,12 +97,16 @@ public class CommandBlurry extends Command
float g = 0; float g = 0;
float b = 0; float b = 0;
for(int xCor = -2; xCor <= 2; xCor++) for(int xCor = -2; xCor <= 2; xCor++)
{ {
for(int yCor = -2; yCor <= 2; yCor++) 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); r += getGaus(current.getRed(), xCor, yCor);
g += getGaus(current.getGreen(), xCor, yCor); g += getGaus(current.getGreen(), xCor, yCor);
b += getGaus(current.getBlue(), xCor, yCor); b += getGaus(current.getBlue(), xCor, yCor);
-1
View File
@@ -151,7 +151,6 @@ public class CommandRoll extends Command
break; break;
case 'd': case 'd':
rolls = roll(first, second); rolls = roll(first, second);
System.out.println(first);
for(int i= 0; i < first; i++) for(int i= 0; i < first; i++)
{ {
value += rolls[i]; value += rolls[i];
+11 -4
View File
@@ -16,22 +16,29 @@ public class SubCommandAdd extends SubCommand
@Override @Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input) public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
{ {
String role = input.args.split(" ")[0]; String [] roles = input.args.split(",");
String role;
String formatted = "";
for(int i = 0; i < roles.length; i++)
{
role = roles[i].trim();
if(guild.roleList.contains(role)) if(guild.roleList.contains(role))
{ {
if(guild.control.addRole(user.discordID, role)) if(guild.control.addRole(user.discordID, role))
{ {
return new SubCommandFormattable("ADDED RIN YOU NEED TO FIX THIS"); formatted += "Addded " + role + "!";
} }
else else
{ {
return new SubCommandFormattable("FAILED RIN YOU NEED TO FIX THIS TOO"); formatted += "Failed to add " + role + "!";
} }
} }
else else
{ {
return new SubCommandFormattable("NOT ALLOWED FIX THIS ONE TOO SNEP FACE"); formatted += "You're not allowed to add " + role + "!";
} }
} }
return new SubCommandFormattable(formatted);
}
} }
@@ -19,18 +19,25 @@ public class SubCommandNotAllowed extends SubCommand
{ {
String lowerInput = input.args.toLowerCase(); String lowerInput = input.args.toLowerCase();
String [] roles = lowerInput.split(","); String [] roles = lowerInput.split(",");
String formatted = "";
if(roles.length < 1)
{
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedNoArgs")));
}
for(String role:roles) for(String role:roles)
{ {
if(guild.roleList.contains(role.trim())) if(guild.roleList.contains(role.trim()))
{ {
guild.roleList.remove(role); guild.roleList.remove(role);
return new SubCommandFormattable(LocStrings.stub("GuildRoleNotAllowedSuccess")); formatted += String.format(LocStrings.stub("GuildRoleNotAllowedSuccess"), role);
} }
else 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);
} }
} }