1
mirror of https://github.com/Shiewk/SModeration.git synced 2026-04-28 05:54:16 +02:00

Internationalization support

This commit is contained in:
Shy
2025-07-30 13:37:30 +02:00
parent a17086b059
commit 2be16da939
31 changed files with 470 additions and 483 deletions
@@ -14,10 +14,9 @@ import org.bukkit.entity.Player;
import java.util.Collection;
import java.util.List;
import static de.shiewk.smoderation.paper.SModerationPaper.*;
import static io.papermc.paper.command.brigadier.Commands.argument;
import static io.papermc.paper.command.brigadier.Commands.literal;
import static net.kyori.adventure.text.Component.text;
import static net.kyori.adventure.text.Component.translatable;
public final class InvseeCommand implements CommandProvider {
@@ -44,13 +43,9 @@ public final class InvseeCommand implements CommandProvider {
Player sender = CommandUtil.getExecutingPlayer(context.getSource());
Player target = CommandUtil.getPlayerSingle(context, "player");
if (sender.equals(target)){
CommandUtil.error("You can't open your own inventory.");
CommandUtil.errorTranslatable("smod.command.invsee.fail.self");
}
sender.sendMessage(CHAT_PREFIX.append(
text("Opening inventory of ").color(PRIMARY_COLOR)
.append(target.teamDisplayName().colorIfAbsent(SECONDARY_COLOR))
.append(text("."))
));
sender.sendMessage(translatable("smod.command.invsee.opening", target.teamDisplayName()));
new InvSeeInventory(sender, target).open();
return Command.SINGLE_SUCCESS;
}
@@ -59,13 +54,9 @@ public final class InvseeCommand implements CommandProvider {
Player sender = CommandUtil.getExecutingPlayer(context.getSource());
Player target = CommandUtil.getPlayerSingle(context, "player");
if (sender.equals(target)){
CommandUtil.error("You can't open your own inventory.");
CommandUtil.errorTranslatable("smod.command.invsee.fail.self");
}
sender.sendMessage(CHAT_PREFIX.append(
text("Opening inventory of ").color(PRIMARY_COLOR)
.append(target.teamDisplayName().colorIfAbsent(SECONDARY_COLOR))
.append(text("."))
));
sender.sendMessage(translatable("smod.command.invsee.opening", target.teamDisplayName()));
new InvSeeEquipmentInventory(sender, target).open();
return Command.SINGLE_SUCCESS;
}