mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-01 14:08:08 +01:00
Add clear to waypoint editor
This commit is contained in:
parent
a1b29a1c52
commit
1cebe9271a
@ -185,6 +185,16 @@ public class LinearWaypointProvider implements WaypointProvider {
|
||||
conversation = TriggerEditPrompt.start(player, LinearWaypointEditor.this);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (event.getMessage().equalsIgnoreCase("clear")) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clearWaypoints();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!event.getMessage().equalsIgnoreCase("toggle path"))
|
||||
return;
|
||||
@ -198,6 +208,12 @@ public class LinearWaypointProvider implements WaypointProvider {
|
||||
});
|
||||
}
|
||||
|
||||
private void clearWaypoints() {
|
||||
editingSlot = 0;
|
||||
waypoints.clear();
|
||||
destroyWaypointMarkers();
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)
|
||||
|
@ -137,7 +137,7 @@ citizens.editors.text.remove-prompt=Enter the index of the entry you wish to rem
|
||||
citizens.editors.text.removed-entry=[[Removed]] entry at index [[{0}]].
|
||||
citizens.editors.text.start-prompt=Type [[add]] to add an entry, [[edit]] to edit entries, [[remove]] to remove entries, [[close]] to toggle the NPC as a close talker, and [[random]] to toggle the NPC as a random talker. Type [[help]] to show this again.
|
||||
citizens.editors.waypoints.linear.added-waypoint=[[Added]] a waypoint at ({0}) ([[{1}]], [[{2}]])
|
||||
citizens.editors.waypoints.linear.begin=<b>Entered the linear waypoint editor!<br> [[Left click]] to add a waypoint, [[right click]] to remove.<br> Type [[toggle path]] to toggle showing entities at waypoints.
|
||||
citizens.editors.waypoints.linear.begin=<b>Entered the linear waypoint editor!<br> [[Left click]] to add a waypoint, [[right click]] to remove.<br> Type [[toggle path]] to toggle showing entities at waypoints, [[triggers]] to enter the trigger editor and [[clear]] to clear all waypoints.
|
||||
citizens.editors.waypoints.linear.edit-slot-set=Editing slot set to [[{0}]] ({1}).
|
||||
citizens.editors.waypoints.linear.end=Exited the linear waypoint editor.
|
||||
citizens.editors.waypoints.linear.not-showing-markers=[[Stopped]] showing waypoint markers.
|
||||
|
Loading…
Reference in New Issue
Block a user