Skip to content

Commit a7ff9c8

Browse files
committed
Release v0.5
1 parent fe6ae19 commit a7ff9c8

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

PowerCamera/src/nl/svenar/powercamera/commands/cmd_help.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
3434
help_messages.add(tellrawbase.replaceAll("%arg%", "select <name>").replaceAll("%help%", "Select a camera path by name").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
3535
help_messages.add(tellrawbase.replaceAll("%arg%", "preview <point_number>").replaceAll("%help%", "Preview a point on the selected camera path").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
3636
help_messages.add(tellrawbase.replaceAll("%arg%", "info").replaceAll("%help%", "Info about the currently selected camera path").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
37-
help_messages
38-
.add(tellrawbase.replaceAll("%arg%", "setduration <duration>").replaceAll("%help%", "Set the total duration of the current camera path").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
39-
help_messages.add(tellrawbase.replaceAll("%arg%", "start").replaceAll("%help%", "Run the camera").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
37+
help_messages.add(tellrawbase.replaceAll("%arg%", "setduration <duration>").replaceAll("%help%", "Set the total duration of the current camera path").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
38+
help_messages.add(tellrawbase.replaceAll("%arg%", "start [cameraname]").replaceAll("%help%", "Run the camera").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
39+
help_messages.add(tellrawbase.replaceAll("%arg%", "startother <playername> <cameraname>").replaceAll("%help%", "Run a camera for a different player").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
4040
help_messages.add(tellrawbase.replaceAll("%arg%", "stop").replaceAll("%help%", "Stop the camera").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
4141
help_messages.add(tellrawbase.replaceAll("%arg%", "stats").replaceAll("%help%", "Show plugin stats").replaceAll("%player%", sender.getName()).replaceAll("%cmd%", commandLabel));
4242

@@ -62,8 +62,9 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
6262
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " preview <point_number>" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Preview a point on the selected camera path");
6363
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " info" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Info about the currently selected camera path");
6464
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " setduration <duration>" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Set the total duration of the current camera path");
65-
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " start" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Run the camera");
65+
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " start [cameraname]" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Run the camera");
6666
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.RED + "/" + commandLabel + " stop" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Stop the camera");
67+
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.GREEN + "/" + commandLabel + " startother <playername> <cameraname>" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Run a camera for a different player");
6768
sender.sendMessage(ChatColor.BLACK + "[" + ChatColor.GREEN + "/" + commandLabel + " stats" + ChatColor.BLACK + "] " + ChatColor.DARK_GREEN + "Show plugin stats");
6869

6970
sender.sendMessage(ChatColor.BLUE + "===" + ChatColor.DARK_AQUA + "-------------------------------" + ChatColor.BLUE + "===");

PowerCamera/src/nl/svenar/powercamera/events/ChatTabExecutor.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import org.bukkit.Bukkit;
67
import org.bukkit.command.Command;
78
import org.bukkit.command.CommandSender;
89
import org.bukkit.command.TabCompleter;
10+
import org.bukkit.entity.Player;
911

1012
import nl.svenar.powercamera.PowerCamera;
1113

@@ -34,6 +36,7 @@ public List<String> onTabComplete(CommandSender sender, Command cmd, String alia
3436
commands_list.add("info");
3537
commands_list.add("setduration");
3638
commands_list.add("start");
39+
commands_list.add("startother");
3740
commands_list.add("stop");
3841
commands_list.add("stats");
3942

@@ -49,6 +52,20 @@ public List<String> onTabComplete(CommandSender sender, Command cmd, String alia
4952
list.add(camera_name);
5053
}
5154
}
55+
56+
if (args[0].equalsIgnoreCase("startother")) {
57+
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
58+
list.add(player.getName());
59+
}
60+
}
61+
}
62+
63+
if (args.length == 3) {
64+
if (args[0].equalsIgnoreCase("startother")) {
65+
for (String camera_name : this.plugin.getConfigCameras().getCameras()) {
66+
list.add(camera_name);
67+
}
68+
}
5269
}
5370

5471
return list;

0 commit comments

Comments
 (0)