mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
use getter to access translation
This commit is contained in:
@@ -104,22 +104,22 @@ public class SkinCommand {
|
||||
Collection<ServerPlayerEntity> players = pair.left();
|
||||
|
||||
if (profiles.isEmpty()) {
|
||||
src.sendError(Text.of(TranslationUtils.translation.skinActionFailed));
|
||||
src.sendError(Text.of(TranslationUtils.getTranslation().skinActionFailed));
|
||||
return;
|
||||
}
|
||||
|
||||
if (setByOperator) {
|
||||
src.sendFeedback(() -> Text.of(
|
||||
String.format(TranslationUtils.translation.skinActionAffectedProfile,
|
||||
String.format(TranslationUtils.getTranslation().skinActionAffectedProfile,
|
||||
String.join(", ", profiles.stream().map(GameProfile::getName).toList()))), true);
|
||||
|
||||
if (!players.isEmpty()) {
|
||||
src.sendFeedback(() -> Text.of(
|
||||
String.format(TranslationUtils.translation.skinActionAffectedPlayer,
|
||||
String.format(TranslationUtils.getTranslation().skinActionAffectedPlayer,
|
||||
String.join(", ", players.stream().map(p -> p.getGameProfile().getName()).toList()))), true);
|
||||
}
|
||||
} else {
|
||||
src.sendFeedback(() -> Text.of(TranslationUtils.translation.skinActionOk), true);
|
||||
src.sendFeedback(() -> Text.of(TranslationUtils.getTranslation().skinActionOk), true);
|
||||
}
|
||||
});
|
||||
return targets.size();
|
||||
|
||||
@@ -16,6 +16,11 @@ public class TranslationUtils {
|
||||
}
|
||||
|
||||
public static final String TRANSLATION_FILENAME = "translation";
|
||||
private static Translation translation = new Translation();
|
||||
|
||||
public static Translation getTranslation() {
|
||||
return translation;
|
||||
}
|
||||
|
||||
static {
|
||||
Path path = SkinRestorer.getConfigDir().resolve(TRANSLATION_FILENAME + SkinIO.FILE_EXTENSION);
|
||||
|
||||
Reference in New Issue
Block a user