Add missing description messages, and prompt users to join Discord to contribute to translations

This commit is contained in:
fullwall 2024-03-02 22:29:05 +08:00
parent b629eab8be
commit 52bb50fd8c
9 changed files with 21 additions and 12 deletions

View File

@ -418,8 +418,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
Template.migrate();
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
commands.registerTabCompletion(this);
commands.setTranslationPrefixProvider(
cmd -> "citizens.commands." + cmd.aliases()[0] + "." + cmd.modifiers()[0]);
commands.setTranslationPrefixProvider(cmd -> "citizens.commands." + cmd.aliases()[0]
+ (cmd.modifiers().length > 0 && !cmd.modifiers()[0].isEmpty() ? "." + cmd.modifiers()[0] : ""));
// Setup NPCs after all plugins have been enabled (allows for multiworld
// support and for NPCs to properly register external settings)
@ -514,6 +514,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
private void setupTranslator() {
Locale locale = Locale.getDefault();
if (!locale.getLanguage().equals("en")) {
Messaging.logTr(Messages.CONTRIBUTE_TO_TRANSLATION_PROMPT);
}
String setting = Setting.LOCALE.asString();
if (!setting.isEmpty()) {
String[] parts = setting.split("[\\._]");

View File

@ -26,7 +26,7 @@ public class AdminCommands {
this.plugin = plugin;
}
@Command(aliases = { "citizens" }, desc = "Show basic plugin information", max = 0, permission = "citizens.admin")
@Command(aliases = { "citizens" }, desc = "", max = 0, permission = "citizens.admin")
public void citizens(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
Messaging.send(sender, StringHelper.wrapHeader("<green>Citizens v" + plugin.getDescription().getVersion()));
Messaging.send(sender, " <yellow>-- <green>Author: fullwall");

View File

@ -18,7 +18,7 @@ public class EditorCommands {
@Command(
aliases = { "npc" },
usage = "copier",
desc = "Toggle the NPC copier",
desc = "",
modifiers = { "copier" },
min = 1,
max = 1,

View File

@ -1862,7 +1862,7 @@ public class NPCCommands {
Messaging.sendTr(sender, Messages.NAMEPLATE_VISIBILITY_SET, old);
}
@Command(aliases = { "npc" }, desc = "Show basic NPC information", max = 0, permission = "citizens.npc.info")
@Command(aliases = { "npc" }, desc = "", max = 0, permission = "citizens.npc.info")
public void npc(CommandContext args, CommandSender sender, NPC npc) {
Messaging.send(sender, StringHelper.wrapHeader(npc.getName()));
Messaging.send(sender, " ID: [[" + npc.getId());

View File

@ -83,7 +83,7 @@ public class WaypointCommands {
@Command(
aliases = { "waypoints", "waypoint", "wp" },
usage = "hpa",
desc = "Debugging command",
desc = "",
modifiers = { "hpa" },
min = 1,
max = 1,

View File

@ -355,9 +355,9 @@ public class HologramTrait extends Trait {
HologramLine line = lines.get(i);
NPC hologramNPC = line.hologram;
if (hologramNPC == null || !hologramNPC.isSpawned()) {
if (hologramNPC == null || !hologramNPC.isSpawned())
continue;
}
if (line.ticks > 0 && --line.ticks == 0) {
line.removeNPC();
lines.remove(i--);

View File

@ -86,6 +86,7 @@ public class Messages {
public static final String COMMANDS_RANDOM_UNSET = "citizens.commands.npc.commands.random-unset";
public static final String COMMANDS_SEQUENTIAL_SET = "citizens.commands.npc.commands.sequential-set";
public static final String COMMANDS_SEQUENTIAL_UNSET = "citizens.commands.npc.commands.sequential-unset";
public static final String CONTRIBUTE_TO_TRANSLATION_PROMPT = "citizens.contribute-to-translations-prompt";
public static final String CONTROLLABLE_REMOVED = "citizens.commands.npc.controllable.removed";
public static final String CONTROLLABLE_SET = "citizens.commands.npc.controllable.set";
public static final String COPIER_EDITOR_BEGIN = "citizens.editors.copier.begin";
@ -367,7 +368,7 @@ public class Messages {
public static final String SHULKER_PEEK_SET = "citizens.commands.npc.shulker.peek-set";
public static final String SITTING_SET = "citizens.commands.npc.sitting.set";
public static final String SITTING_UNSET = "citizens.commands.npc.sitting.unset";
public static final String SIZE_DESCRIPTION = "citizens.commands.npc.size.description";
public static final String SIZE_DESCRIPTION = "citizens.commands.npc.size.describe";
public static final String SIZE_SET = "citizens.commands.npc.size.set";
public static final String SKELETON_TYPE_SET = "citizens.commands.npc.skeletontype.set";
public static final String SKIN_CLEARED = "citizens.commands.npc.skin.cleared";

View File

@ -478,9 +478,10 @@ public class Util {
}
} catch (Throwable t) {
t.printStackTrace();
}
if (op) {
clicker.setOp(wasOp);
} finally {
if (op) {
clicker.setOp(wasOp);
}
}
}

View File

@ -1,5 +1,6 @@
{
"citizens.changed-implementation" : "Citizens implementation changed, disabling plugin.",
"citizens.contribute-to-translations-prompt" : "Detected system language [[{0}]]. If you'd like you can contribute to Citizens translations via our Discord! https://discord.gg/Q6pZGSR",
"citizens.commands.citizens.reload.description" : "Load Citizens fresh from disk, without saving first",
"citizens.commands.citizens.save.description" : "Save NPCs",
"citizens.commands.citizens.save.help" : "Use the -a flag to save async (off the main server thread).",
@ -13,6 +14,7 @@
"citizens.commands.invalid-number" : "That is not a valid number.",
"citizens.commands.invalid.class" : "Invalid external commands class.",
"citizens.commands.npc.activationrange.description" : "Sets the activation range",
"citizens.commands.citizens.description" : "Show basic plugin information",
"citizens.commands.npc.activationrange.set" : "Activation range set to [[{0}]].",
"citizens.commands.npc.age.cannot-be-aged" : "The mob type {0} cannot be aged.",
"citizens.commands.npc.age.description" : "Set the age of an NPC",
@ -22,11 +24,13 @@
"citizens.commands.npc.age.set" : "[[{0}]] is now [[{1}]].",
"citizens.commands.npc.age.set-adult" : "[[{0}]] is now an adult.",
"citizens.commands.npc.age.set-baby" : "[[{0}]] is now a baby.",
"citizens.commands.waypoints.hpa" : "Command for Citizens developers testing new pathfinding only",
"citizens.commands.npc.age.set-normal" : "[[{0}]] is now age [[{1}]].",
"citizens.commands.npc.age.unlocked" : "Age unlocked.",
"citizens.commands.npc.aggressive.description" : "Sets the aggressive status of the entity",
"citizens.commands.npc.ai.description" : "Sets whether the NPC should use vanilla AI",
"citizens.commands.npc.ai.started" : "Now using Minecraft AI.",
"citizens.commands.npc.description" : "Show basic NPC information",
"citizens.commands.npc.ai.stopped" : "No longer using Minecraft AI.",
"citizens.commands.npc.allay.dancing-set" : "[[{0}]] is now dancing.",
"citizens.commands.npc.allay.dancing-unset" : "[[{0}]] is no longer dancing.",