Skip to content

Commit

Permalink
Check plugin instead of command
Browse files Browse the repository at this point in the history
  • Loading branch information
yyrichy committed Dec 18, 2021
1 parent 25a3a4d commit 625a168
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ public boolean onCommand(CommandSender commandSender, Command command, String la
commandSender.sendMessage(ChatColor.RED + "You must be a player to use this command.");
return true;
}
Command brushCommand = Bukkit.getServer().getPluginCommand("/schbr");
if (brushCommand == null) {
commandSender.sendMessage(ChatColor.RED + "SchematicBrush is not installed on the server, command //schbr does not exist.");
if (Bukkit.getPluginManager().getPlugin("SchematicBrush") == null) {
commandSender.sendMessage(ChatColor.RED + "Plugin SchematicBrush is not installed.");
return true;
}

if (args.length == 0) {
commandSender.sendMessage(ChatColor.RED + "Specify a tree type: " + String.join(", ", treeTypes()));
return true;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ name: ${project.name}
version: ${project.version}
depend:
- WorldEdit
softdepend:
- SchematicBrush
commands:
wood:
description: Creates a forest/wood in your selection from schematics
Expand Down

0 comments on commit 625a168

Please sign in to comment.