Skip to content

Commit 5c35133

Browse files
committed
refactor: update ENDSTONE_PLUGIN due to API change
1 parent 0405f01 commit 5c35133

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/example_plugin.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@
55
// The ENDSTONE_PLUGIN macro defines the metadata for the plugin.
66
ENDSTONE_PLUGIN(/*name=*/"CppExamplePlugin", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin)
77
{
8-
plugin.description = "C++ example plugin for Endstone servers";
9-
plugin.website = "https://github.com/EndstoneMC/cpp-example-plugin";
10-
plugin.authors = {"Endstone Developers <hello@endstone.dev>"};
8+
description = "C++ example plugin for Endstone servers";
9+
website = "https://github.com/EndstoneMC/cpp-example-plugin";
10+
authors = {"Endstone Developers <hello@endstone.dev>"};
1111

12-
plugin.command("debug")
12+
command("debug") //
1313
.description("Print debug information.")
1414
.usages("/debug")
1515
.permissions("cpp_example.command.debug");
1616

17-
plugin.command("fibonacci")
17+
command("fibonacci")
1818
.description("A simple command that writes the Fibonacci series up to n.")
1919
.usages("/fibonacci <n: int>")
2020
.aliases("fib")
2121
.permissions("cpp_example.command.fibonacci", "cpp_example.command.fibonacci.large_n");
2222

23-
plugin.permission("cpp_example.command")
23+
permission("cpp_example.command")
2424
.description("Allow users to use all commands provided by this example plugin")
2525
.children("cpp_example.command.debug", true)
2626
.children("cpp_example.command.fibonacci", true);
2727

28-
plugin.permission("cpp_example.command.debug")
28+
permission("cpp_example.command.debug")
2929
.description("Allow users to use the debug command")
3030
.default_(endstone::PermissionDefault::Operator);
3131

32-
plugin.permission("cpp_example.command.fibonacci")
32+
permission("cpp_example.command.fibonacci")
3333
.description("Allow users to use the fibonacci command")
3434
.default_(endstone::PermissionDefault::True)
3535
.children("cpp_example.command.fibonacci.large_n", true);
3636

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

0 commit comments

Comments
 (0)