chore: unify checkstyle, fix violations, cleanup bin/

This commit is contained in:
loki5512344 2026-07-12 00:59:08 +02:00
parent 6af62d3bf6
commit 103c982f87
Signed by: boba
GPG key ID: 253067914055423B
162 changed files with 35 additions and 2638 deletions

View file

@ -121,7 +121,7 @@ public class BanCommand implements CommandExecutor, TabCompleter {
long durationMs;
if (timeStr == null || timeStr.isEmpty()) {
durationMs = 0;
} else if (timeStr.equalsIgnoreCase("perm") || timeStr.equals("0")) {
} else if ("perm".equalsIgnoreCase(timeStr) || "0".equals(timeStr)) {
durationMs = 0;
} else {
durationMs = muteService.parseTime(timeStr);
@ -136,7 +136,7 @@ public class BanCommand implements CommandExecutor, TabCompleter {
}
private boolean isTimeFormat(String s) {
return s.equalsIgnoreCase("perm") || s.matches("\\d+[dhms]?");
return "perm".equalsIgnoreCase(s) || s.matches("\\d+[dhms]?");
}
@Override

View file

@ -89,7 +89,7 @@ public class MuteCommand implements CommandExecutor, TabCompleter {
StringBuilder reasonBuilder = new StringBuilder();
for (String arg : args) {
if (arg.equalsIgnoreCase("-s")) {
if ("-s".equalsIgnoreCase(arg)) {
silent = true;
} else if (targetName == null) {
targetName = arg;
@ -126,7 +126,7 @@ public class MuteCommand implements CommandExecutor, TabCompleter {
}
return dur;
}
if (timeStr.equalsIgnoreCase("perm") || timeStr.equals("0")) {
if ("perm".equalsIgnoreCase(timeStr) || "0".equals(timeStr)) {
return 0;
}
long dur = muteService.parseTime(timeStr);
@ -176,7 +176,7 @@ public class MuteCommand implements CommandExecutor, TabCompleter {
}
private boolean isTimeFormat(String s) {
return s.equalsIgnoreCase("perm") || s.matches("\\d+[dhms]?");
return "perm".equalsIgnoreCase(s) || s.matches("\\d+[dhms]?");
}
@Override

View file

@ -41,7 +41,7 @@ public class UnmuteCommand implements CommandExecutor, TabCompleter {
String targetName = null;
boolean silent = false;
for (String a : args) {
if (a.equalsIgnoreCase("-s")) {
if ("-s".equalsIgnoreCase(a)) {
silent = true;
} else if (targetName == null) {
targetName = a;

View file

@ -78,7 +78,7 @@ public class PlayerServiceImpl implements PlayerService {
}
private Map<UUID, Long> getCooldownMap(String type) {
return type.equals("global") ? globalCooldowns : localCooldowns;
return "global".equals(type) ? globalCooldowns : localCooldowns;
}
// ========== Statistics Implementation ==========

View file

@ -88,7 +88,7 @@ public class GradientColorCommand implements CommandExecutor, TabCompleter {
String firstArg = args[0].toLowerCase();
if (args.length == 2 && firstArg.equals("copy")) {
if (args.length == 2 && "copy".equals(firstArg)) {
return Bukkit.getOnlinePlayers().stream().map(Player::getName)
.filter(s -> s.toLowerCase().startsWith(args[1].toLowerCase())).toList();
}

View file

@ -132,7 +132,7 @@ public class AutoMessageManager {
String messageKey;
if (mode.equals("random")) {
if ("random".equals(mode)) {
messageKey = messageOrder.get(random.nextInt(messageOrder.size()));
} else {
int index = currentIndex.getAndUpdate(i -> (i + 1) % messageOrder.size());

View file

@ -43,7 +43,7 @@ public class EmojiManager {
// Загружаем все категории
for (String category : config.getKeys(false)) {
if (category.equals("settings")) {
if ("settings".equals(category)) {
continue;
}