Skip to content

Commit

Permalink
0.1.2: Bug fix and /nss error (#1)
Browse files Browse the repository at this point in the history
* Ability to hide party requests when api fails
* Version bump
  • Loading branch information
symt authored Aug 20, 2021
1 parent ecec8fe commit 3f38b83
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ compileJava {
targetCompatibility = '1.8'
}

version = "0.1.1"
version = "0.1.2"
group= "dev.meyi.noscamspam"
archivesBaseName = "NoScamSpam"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/meyi/noscamspam/NoScamSpam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class NoScamSpam {

public static final String MODID = "NoScamSpam";
public static final String VERSION = "0.1.1";
public static final String VERSION = "0.1.2";
public static final Gson gson = new Gson();
public static final String PREFIX =
EnumChatFormatting.BLACK + "[" + EnumChatFormatting.RED + "NSS"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/meyi/noscamspam/checks/UserCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public static boolean shouldBlockUser(String username) {
e.printStackTrace();
}

return false;
return !NoScamSpam.config.showOnError;
}
}
16 changes: 14 additions & 2 deletions src/main/java/dev/meyi/noscamspam/commands/NoScamSpamCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,27 @@ public void processCommand(ICommandSender ics, String[] args) throws NumberInval
NoScamSpam.PREFIX + EnumChatFormatting.RED
+ "Run /nss api (key) to set your api key. Do /api if you need to get your api key."));
}
} else if (args.length == 1 && args[0].equalsIgnoreCase("error")) {
NoScamSpam.config.showOnError ^= true;
player.addChatMessage(new ChatComponentText(
NoScamSpam.PREFIX + (NoScamSpam.config.showOnError ? EnumChatFormatting.GREEN
: EnumChatFormatting.RED)
+ "On API errors, the party invite will be " +
(NoScamSpam.config.showOnError ? EnumChatFormatting.DARK_GREEN
+ "" + EnumChatFormatting.BOLD + "SHOWN"
: EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "HIDDEN")
));
} else {
player.addChatMessage(new ChatComponentText(
NoScamSpam.PREFIX + EnumChatFormatting.GREEN + "Help\n" + EnumChatFormatting.DARK_GREEN
+ EnumChatFormatting.BOLD
+ " - " + EnumChatFormatting.GREEN + "bounds (skill|cata|network) (number)" + "\n"
+ " - " + EnumChatFormatting.GREEN + "check (skill|cata|network) (number)" + "\n"
+ EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD
+ " - " + EnumChatFormatting.GREEN + "whitelist (add|remove|reset) (username)"
+ "\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD
+ " - " + EnumChatFormatting.GREEN + "api (key)"));
+ " - " + EnumChatFormatting.GREEN + "api (key)"
+ "\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD
+ " - " + EnumChatFormatting.GREEN + "error"));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/dev/meyi/noscamspam/json/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Config {
public int catacombsLevel;

public List<String> whitelist;
public boolean showOnError = true;

public Config() {
apiKey = "";
Expand Down

0 comments on commit 3f38b83

Please sign in to comment.