diff --git a/include/example_plugin.h b/include/example_plugin.h index 2d91386..19f0b9a 100644 --- a/include/example_plugin.h +++ b/include/example_plugin.h @@ -15,11 +15,17 @@ class ExamplePlugin : public endstone::Plugin { void onEnable() override { getLogger().info("onEnable is called"); + + auto *root = registerPermission("cpp_example.command", + "Allow users to use all commands provided by this example plugin"); + registerPermission(root, "cpp_example.command.fibonacci", "Allow users to use the fibonacci command", + endstone::PermissionDefault::Operator); + registerCommand("fibonacci", // name "A simple command that writes the Fibonacci series up to n.", // description {"/fibonacci "}, // usages - {"fib"} // aliases - ) + {"fib"}, // aliases + {"cpp_example.command.fibonacci"}) // permissions ->setExecutor(std::make_unique()); }