Skip to content

Commit

Permalink
fix: compilation errors due to API update
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Apr 30, 2024
1 parent f3630ae commit cefb73d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/example_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class ExamplePlugin : public endstone::Plugin {
const std::vector<std::string> &args) override
{
// You can also handle commands here instead of setting an executor in onEnable if you prefer
if (command.getName() == "debug") {
if (command.getName() == "whoami") {
if (sender.isOp()) {
sender.sendMessage(endstone::ColorFormat::DARK_GREEN + "You are seeing this because you are the OP!");
sender.sendMessage(endstone::ColorFormat::DarkGreen + "You are seeing this because you are the OP!");
}
else {
sender.sendErrorMessage("You should never see this!");
Expand Down
14 changes: 7 additions & 7 deletions src/example_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ENDSTONE_PLUGIN(/*name=*/"CppExamplePlugin", /*version=*/"0.4.0", /*main_class=*
website = "https://github.com/EndstoneMC/cpp-example-plugin";
authors = {"Endstone Developers <[email protected]>"};

command("debug") //
.description("Print debug information.")
.usages("/debug")
.permissions("cpp_example.command.debug");
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.")
Expand All @@ -22,11 +22,11 @@ ENDSTONE_PLUGIN(/*name=*/"CppExamplePlugin", /*version=*/"0.4.0", /*main_class=*

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.whoami", true)
.children("cpp_example.command.fibonacci", true);

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

permission("cpp_example.command.fibonacci")
Expand Down

0 comments on commit cefb73d

Please sign in to comment.