Skip to content

Commit

Permalink
Update Handler.java
Browse files Browse the repository at this point in the history
Change to make it compatible with Java8-16
  • Loading branch information
LW-Davide authored Feb 13, 2024
1 parent ddbcbf5 commit 72e0af5
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions common/src/main/java/host/bloom/ab/common/commands/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,34 @@ private void sendHelpMessage(Sender sender) {
triggerStatus = "§aTrigger is not currently enabled.";
}

sender.sendMessage("""
§8§m §r
§6§lBLOOMAB COMMANDS§r:
§e/bab force §6<seconds>§r: §7Enable force trigger for X seconds
§e/bab forcestop§r: §7Force stop the trigger and keep it disabled until the finish of the attack
§e/bab set maxjps §6<number>§r: §7Set max joins per second
§e/bab set duration §6<seconds>§r: §7Set trigger duration
§e/bab set location §6<location>§r: §7Set server location
§r
§6§lCONNECTION STATS§r:
§7• §eTrigger joins per second: §6%s rps
§7• §eTrigger duration: §6%s seconds
§7• §eBlock new joins: §6%s
§7• §eCurrent joins per second: §6%s
§7• %s
§8§m §r
"""
.formatted(
plugin.getABConfig().maxJoinsPerSecond,
plugin.getABConfig().triggerDuration,
plugin.getABConfig().blockNewJoins,
plugin.getManager().getCurrentCount(System.currentTimeMillis() / 1000),
triggerStatus
)
);
String[] messageLines = {
"§8§m §r",
"§6§lBloomAB COMMANDS§r:",
"§e/bab force §6<seconds>§r: §7Enable force trigger for X seconds",
"§e/bab forcestop§r: §7Force stop the trigger and keep it disabled until the finish of the attack",
"§e/bab set maxjps §6<number>§r: §7Set max joins per second",
"§e/bab set duration §6<seconds>§r: §7Set trigger duration",
"§e/bab set location §6<location>§r: §7Set server location",
"§r",
"§6§lCONNECTION STATS§r:",
"§7• §eTrigger joins per second: §6%s rps",
"§7• §eTrigger duration: §6%s seconds",
"§7• §eBlock new joins: §6%s",
"§7• §eCurrent joins per second: §6%s",
"§7• %s",
"§8§m §r"
};

String formattedMessage = String.format(
String.join("%n", messageLines),
plugin.getABConfig().maxJoinsPerSecond,
plugin.getABConfig().triggerDuration,
plugin.getABConfig().blockNewJoins,
plugin.getManager().getCurrentCount(System.currentTimeMillis() / 1000),
triggerStatus
);

sender.sendMessage(formattedMessage);

}
}

0 comments on commit 72e0af5

Please sign in to comment.