=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

+14 -6
View File
@@ -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);
+1 -2
View File
@@ -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;
+16 -9
View File
@@ -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);
}
}
@@ -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);
}
}