Print command usage for /paper entity list at more places (#5282)

This commit is contained in:
Michael 2021-02-28 15:01:26 -08:00
parent 1bc1a162c4
commit a26dc45546

View File

@ -164,6 +164,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ if (names.isEmpty()) {
+ sender.sendMessage(ChatColor.RED + "Invalid filter, does not match any entities. Use /paper entity list for a proper list");
+ sender.sendMessage(ChatColor.RED + "Usage: /paper entity list [filter] [worldName]");
+ return;
+ }
+
@ -175,6 +176,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } else {
+ sender.sendMessage(ChatColor.RED + "Please specify the name of a world");
+ sender.sendMessage(ChatColor.RED + "To do so without a filter, specify '*' as the filter");
+ sender.sendMessage(ChatColor.RED + "Usage: /paper entity list [filter] [worldName]");
+ return;
+ }
+
@ -182,6 +184,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ World bukkitWorld = Bukkit.getWorld(worldName);
+ if (bukkitWorld == null) {
+ sender.sendMessage(ChatColor.RED + "Could not load world for " + worldName + ". Please select a valid world.");
+ sender.sendMessage(ChatColor.RED + "Usage: /paper entity list [filter] [worldName]");
+ return;
+ }
+ WorldServer world = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle();