forked from EndstoneMC/cpp-example-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_plugin.cpp
More file actions
40 lines (32 loc) · 1.67 KB
/
Copy pathexample_plugin.cpp
File metadata and controls
40 lines (32 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2024, The Endstone Project. (https://endstone.dev) All Rights Reserved.
#include "example_plugin.h"
// The ENDSTONE_PLUGIN macro defines the metadata for the plugin.
ENDSTONE_PLUGIN(/*name=*/"cpp_example", /*version=*/"0.5.0", /*main_class=*/ExamplePlugin)
{
prefix = "CppExamplePlugin";
description = "C++ example plugin for Endstone servers";
website = "https://github.com/EndstoneMC/cpp-example-plugin";
authors = {"Endstone Developers <hello@endstone.dev>"};
command("whoami") //
.description("Print the information of command executor.")
.usages("/whoami")
.permissions("cpp_example.command.whoami");
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");
permission("cpp_example.command")
.description("Allow users to use all commands provided by this example plugin")
.children("cpp_example.command.whoami", true)
.children("cpp_example.command.fibonacci", true);
permission("cpp_example.command.whoami")
.description("Allow users to use the whoami command")
.default_(endstone::PermissionDefault::Operator);
permission("cpp_example.command.fibonacci")
.description("Allow users to use the fibonacci command")
.default_(endstone::PermissionDefault::True);
permission("cpp_example.command.fibonacci.large_n")
.description("Allow users to use the fibonacci command with n >= 1000")
.default_(endstone::PermissionDefault::Operator);
}