From cefb73dcb327ae95313a19ca9d181a50aa62d4e0 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 30 Apr 2024 10:57:24 +0100 Subject: [PATCH] fix: compilation errors due to API update --- include/example_plugin.h | 4 ++-- src/example_plugin.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/example_plugin.h b/include/example_plugin.h index 366bac2..8d7b58e 100644 --- a/include/example_plugin.h +++ b/include/example_plugin.h @@ -43,9 +43,9 @@ class ExamplePlugin : public endstone::Plugin { const std::vector &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!"); diff --git a/src/example_plugin.cpp b/src/example_plugin.cpp index ec7bfa5..38705d5 100644 --- a/src/example_plugin.cpp +++ b/src/example_plugin.cpp @@ -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 "}; - 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.") @@ -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")