diff --git a/include/endstone/command/command.h b/include/endstone/command/command.h index 2baca32bc..fa8e86c85 100644 --- a/include/endstone/command/command.h +++ b/include/endstone/command/command.h @@ -28,10 +28,8 @@ namespace endstone { */ class Command { public: - explicit Command(CommandMap &command_map) : command_map_(command_map) {} virtual ~Command() = default; -public: /** * Executes the command, returning its success * @@ -67,8 +65,5 @@ class Command { { return {}; } - -private: - CommandMap &command_map_; }; } // namespace endstone diff --git a/include/endstone/command/command_usage.h b/include/endstone/command/command_usage.h new file mode 100644 index 000000000..a69e8742a --- /dev/null +++ b/include/endstone/command/command_usage.h @@ -0,0 +1,19 @@ +// Copyright (c) 2024, The Endstone Project. (https://endstone.dev) All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +class CommandUsage { + +}; diff --git a/include/endstone/command/plugin_command.h b/include/endstone/command/plugin_command.h index 0298a5636..2b1a9e6ee 100644 --- a/include/endstone/command/plugin_command.h +++ b/include/endstone/command/plugin_command.h @@ -27,7 +27,7 @@ namespace endstone { class PluginCommand : public Command { public: - PluginCommand(CommandMap &command_map, Plugin &owner) : Command(command_map), owner_(owner) {} + PluginCommand(CommandMap &command_map, Plugin &owner) : command_map_(command_map), owner_(owner) {} bool execute(CommandSender &sender, const std::map &args) const override { @@ -82,5 +82,6 @@ class PluginCommand : public Command { private: Plugin &owner_; std::shared_ptr executor_; + CommandMap &command_map_; }; } // namespace endstone diff --git a/src/endstone_runtime/linux/hook.cpp b/src/endstone_runtime/linux/hook.cpp index 7798e149b..9dd2855e2 100644 --- a/src/endstone_runtime/linux/hook.cpp +++ b/src/endstone_runtime/linux/hook.cpp @@ -124,7 +124,7 @@ const std::error_category &hook_error_category() { static const class HookErrorCategory : public std::error_category { public: - [[nodiscard]] const char *name() const override + [[nodiscard]] const char *name() const noexcept override { return "HookError"; } diff --git a/src/endstone_runtime/windows/hook.cpp b/src/endstone_runtime/windows/hook.cpp index 1edecb5f9..c70183227 100644 --- a/src/endstone_runtime/windows/hook.cpp +++ b/src/endstone_runtime/windows/hook.cpp @@ -151,7 +151,7 @@ const std::error_category &hook_error_category() { static const class HookErrorCategory : public std::error_category { public: - [[nodiscard]] const char *name() const override + [[nodiscard]] const char *name() const noexcept override { return "HookError"; }