Skip to content

Commit

Permalink
Added opt out to defense tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
newracket committed Jul 6, 2022
1 parent 4c7e524 commit 104a306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/java/tk/avicia/avomod/Avomod.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class Avomod {
new ConfigToggle("War", "Prevent joining wars when afk", "Enabled", "afkWarProtection"),
new ConfigInput("War", "Minutes until considered afk", "10", "[0-9]+", "^[0-9]+$", 3, "afkTime"),
new ConfigInput("War", "Territory attack confirmation threshold", "15000", "[0-9]+", "^[0-9]+$", 6, "attackConfirmation"),
new ConfigToggle("War", "Send defenses from attacked territories to server (improves accuracy of timer list for guild members)", "Enabled", "storeDefs"),
new ConfigToggle("Misc", "Auto /stream on World Swap", "Disabled", "autoStream"),
new ConfigToggle("Misc", "Prevent Moving Armor/Accessories", "Disabled", "disableMovingArmor"),
new ConfigToggle("Misc", "Make Mob Health Bars More Readable", "Enabled", "readableHealth"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ public static void inMenu() {
}

public static void receivedChatMessage(String message, String territory) {
if (System.currentTimeMillis() - currentTime < 5000 && territory.equals(currentTerritory)) {
if (Avomod.getConfigBoolean("terrDefenseInChat")) {
Avomod.getMC().player.sendChatMessage("/g " + currentTerritory + " defense is " + currentDefense);
}
if (System.currentTimeMillis() - currentTime > 5000 || !territory.equals(currentTerritory)) return;

if (Avomod.getConfigBoolean("terrDefenseInChat")) {
Avomod.getMC().player.sendChatMessage("/g " + currentTerritory + " defense is " + currentDefense);
}

if (Avomod.getConfigBoolean("storeDefs")) {
try {
recordDefense(message, territory, currentDefense);
} catch (Exception e) {
e.printStackTrace();
}
} else {
recordDefense(message, territory, "Unknown");
}
}

Expand Down

0 comments on commit 104a306

Please sign in to comment.