Add messages for chat waypoint trigger

This commit is contained in:
fullwall 2020-10-12 21:10:49 +08:00
parent 4591b9e3a9
commit 13dee3570f
4 changed files with 9 additions and 4 deletions

View File

@ -280,12 +280,11 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
clearWaypoints();
}
});
} else if (message.equalsIgnoreCase("toggle path")) {
} else if (message.equalsIgnoreCase("toggle path") || message.equalsIgnoreCase("markers")) {
event.setCancelled(true);
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
// we need to spawn entities on the main thread.
togglePath();
}
});

View File

@ -23,6 +23,7 @@ public class ChatTriggerPrompt extends StringPrompt implements WaypointTriggerPr
if (input.startsWith("radius")) {
try {
radius = Double.parseDouble(input.split(" ")[1]);
Messaging.sendTr((CommandSender) context.getForWhom(), Messages.CHAT_TRIGGER_RADIUS_SET, radius);
} catch (NumberFormatException e) {
Messaging.sendErrorTr((CommandSender) context.getForWhom(),
Messages.WAYPOINT_TRIGGER_CHAT_INVALID_RADIUS);
@ -36,6 +37,7 @@ public class ChatTriggerPrompt extends StringPrompt implements WaypointTriggerPr
return (Prompt) context.getSessionData(WaypointTriggerPrompt.RETURN_PROMPT_KEY);
}
lines.add(input);
Messaging.sendTr((CommandSender) context.getForWhom(), Messages.CHAT_TRIGGER_MESSAGE_ADDED, input);
return this;
}

View File

@ -33,7 +33,9 @@ public class Messages {
public static final String CAT_STOPPED_LYING = "citizens.commands.npc.cat.lying-stop";
public static final String CAT_STOPPED_SITTING = "citizens.commands.npc.cat.sitting-stop";
public static final String CAT_TYPE_SET = "citizens.commands.npc.cat.type-set";
public static final String CHAT_TRIGGER_MESSAGE_ADDED = "citizens.editors.waypoints.triggers.chat.message-added";
public static final String CHAT_TRIGGER_PROMPT = "citizens.editors.waypoints.triggers.chat.prompt";
public static final String CHAT_TRIGGER_RADIUS_SET = "citizens.editors.waypoints.triggers.chat.radius-set";
public static final String CITIZENS_IMPLEMENTATION_DISABLED = "citizens.changed-implementation";
public static final String CITIZENS_INCOMPATIBLE = "citizens.notifications.incompatible-version";
public static final String CITIZENS_INVALID_COMMAND_CLASS = "citizens.commands.invalid.class";

View File

@ -247,7 +247,7 @@ citizens.commands.npc.zombiemod.villager-profession-set=[[{0}]]''s profession se
citizens.commands.page-missing=The page [[{0}]] does not exist.
citizens.commands.requirements.disallowed-mobtype=The NPC cannot be the mob type [[{0}]] for that command.
citizens.commands.requirements.living-entity=The NPC must be a living entity.
citizens.commands.requirements.missing-permission=You don't have permission to execute that command.
citizens.commands.requirements.missing-permission=You don''t have permission to execute that command.
citizens.commands.requirements.missing-required-trait=Missing required trait [[{0}]].
citizens.commands.requirements.must-be-ingame=You must be ingame to use that command.
citizens.commands.requirements.must-be-owner=You must be the owner of this NPC to execute that command.
@ -285,7 +285,7 @@ citizens.editors.already-in-editor=You''re already in an editor!
citizens.editors.copier.begin=<b>Entered the NPC copier!<br>Click anywhere to copy the currently selected NPC.
citizens.editors.copier.end=Exited the NPC copier.
citizens.editors.equipment.all-items-removed=[[{0}]] had all of its items removed.
citizens.editors.equipment.begin=<b>Entered the equipment editor!<br>[[Right click]] to equip the NPC or [[crouch right click]] to change the item in hand!<br>Type [[offhand]], [[chestplate]], [[helmet]], etc. in chat to equip specific slots with the item you're holding!
citizens.editors.equipment.begin=<b>Entered the equipment editor!<br>[[Right click]] to equip the NPC or [[crouch right click]] to change the item in hand!<br>Type [[offhand]], [[chestplate]], [[helmet]], etc. in chat to equip specific slots with the item you''re holding!
citizens.editors.equipment.end=Exited the equipment editor.
citizens.editors.equipment.invalid-block=Invalid block!
citizens.editors.equipment.saddled-set=[[{0}]] is now saddled.
@ -349,6 +349,8 @@ citizens.editors.waypoints.triggers.animation.prompt=Enter in animations to perf
citizens.editors.waypoints.triggers.animation.invalid-animation=Invalid animation [[{0}]]. Valid animations are {1}.
citizens.editors.waypoints.triggers.chat.invalid-radius=The radius must be a number.
citizens.editors.waypoints.triggers.chat.missing-radius=No radius supplied.
citizens.editors.waypoints.triggers.chat.message-added=Message added: [[{0}]].
citizens.editors.waypoints.triggers.chat.radius-set=Radius set to [[{0}]] blocks.
citizens.editors.waypoints.triggers.chat.prompt=Enter in chat lines to say.<br>Type in [[radius (radius)]] to set the block radius to broadcast the messages.<br>Type [[finish]] to finish the chat trigger or [[back]] to return to the previous prompt.
citizens.editors.waypoints.triggers.delay.prompt=Enter the delay in [[server ticks]] to use. (20 ticks = 1 second)
citizens.editors.waypoints.triggers.main.missing-waypoint=Not editing a waypoint.