Skip to content

Commit

Permalink
refactor: remove python bindings related to CommandMap
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Mar 6, 2024
1 parent 8f87f0d commit 8b3b757
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
8 changes: 0 additions & 8 deletions python/src/endstone/_internal/endstone_python.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ class Command:
"""
Executes the command, returning its success
"""
def register_to(self, command_map: ...) -> bool:
"""
Registers this command to a CommandMap
"""
def unregister_from(self, command_map: ...) -> bool:
"""
Unregisters this command from a CommandMap
"""
@property
def aliases(self) -> list[str]:
"""
Expand Down
6 changes: 1 addition & 5 deletions src/endstone_python/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void init_command(py::module &m)
"Returns the server instance that this command is running on")
.def_property_readonly("name", &CommandSender::getName, "Gets the name of this command sender");

py::class_<Command>(m, "Command")
py_class<Command>(m, "Command")
.def(py::init(&createCommand), py::arg("name"), py::arg("description") = py::none(),
py::arg("usages") = py::none(), py::arg("aliases") = py::none())
.def("execute", &Command::execute, py::arg("sender"), py::arg("args"),
Expand All @@ -77,10 +77,6 @@ void init_command(py::module &m)
"usages", &Command::getUsages,
[](Command &self, const std::vector<std::string> &usages) { self.setUsages(usages); },
"List of usages of this command")
.def("register_to", &endstone::Command::registerTo, py::arg("command_map"),
"Registers this command to a CommandMap")
.def("unregister_from", &endstone::Command::unregisterFrom, py::arg("command_map"),
"Unregisters this command from a CommandMap")
.def_property_readonly("registered", &endstone::Command::isRegistered,
"Returns the current registered state of this command");

Expand Down

0 comments on commit 8b3b757

Please sign in to comment.