Skip to content

Commit

Permalink
refactor: update ENDSTONE_PLUGIN due to API change
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Apr 6, 2024
1 parent 0405f01 commit 5c35133
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/example_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@
// The ENDSTONE_PLUGIN macro defines the metadata for the plugin.
ENDSTONE_PLUGIN(/*name=*/"CppExamplePlugin", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin)
{
plugin.description = "C++ example plugin for Endstone servers";
plugin.website = "https://github.com/EndstoneMC/cpp-example-plugin";
plugin.authors = {"Endstone Developers <[email protected]>"};
description = "C++ example plugin for Endstone servers";
website = "https://github.com/EndstoneMC/cpp-example-plugin";
authors = {"Endstone Developers <[email protected]>"};

plugin.command("debug")
command("debug") //
.description("Print debug information.")
.usages("/debug")
.permissions("cpp_example.command.debug");

plugin.command("fibonacci")
command("fibonacci")
.description("A simple command that writes the Fibonacci series up to n.")
.usages("/fibonacci <n: int>")
.aliases("fib")
.permissions("cpp_example.command.fibonacci", "cpp_example.command.fibonacci.large_n");

plugin.permission("cpp_example.command")
permission("cpp_example.command")
.description("Allow users to use all commands provided by this example plugin")
.children("cpp_example.command.debug", true)
.children("cpp_example.command.fibonacci", true);

plugin.permission("cpp_example.command.debug")
permission("cpp_example.command.debug")
.description("Allow users to use the debug command")
.default_(endstone::PermissionDefault::Operator);

plugin.permission("cpp_example.command.fibonacci")
permission("cpp_example.command.fibonacci")
.description("Allow users to use the fibonacci command")
.default_(endstone::PermissionDefault::True)
.children("cpp_example.command.fibonacci.large_n", true);

plugin.permission("cpp_example.command.fibonacci.large_n")
permission("cpp_example.command.fibonacci.large_n")
.description("Allow users to use the fibonacci command with n >= 1000")
.default_(endstone::PermissionDefault::Operator);
}

0 comments on commit 5c35133

Please sign in to comment.