Fixes some warnings, and updates dependencies

This commit is contained in:
2023-09-23 19:15:11 +02:00
parent 191f548f5a
commit 72ea5600fe
5 changed files with 13 additions and 6 deletions
pom.xml
src/main
java
net
resources

@ -56,7 +56,7 @@ public final class TimeFormatter {
String text = BlacksmithPlugin.getTranslator().getTranslatedMessage(BlacksmithTranslatableMessage.valueOf(interval.name()));
//Choose a random entry if a comma-separated list is provided
if (text != null && text.contains(",")) {
if (text.contains(",")) {
String[] parts = text.split(",");
String randomPart = parts[new Random().nextInt(parts.length)];
if (randomPart != null) {
@ -65,7 +65,7 @@ public final class TimeFormatter {
}
//Use the set message, or use the default
if (text != null && !text.trim().isEmpty()) {
if (!text.trim().isEmpty()) {
return text;
} else {
return interval.getDefaultText();