feat:adapt to levilamina 26.10

Signed-off-by: wed150 <wed15058338634@outlook.com>
This commit is contained in:
2026-06-13 23:56:04 +08:00
Unverified
parent bae1484e0f
commit 0749023acb
4 changed files with 164 additions and 57 deletions
+9 -9
View File
@@ -9,18 +9,18 @@
#include "gmlib/mc/world/actor/Actor.h"
void RegisterCommand() {
auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand(
auto& cmd = ll::command::CommandRegistrar::getInstance(false).getOrCreateCommand(
"inventorycheck",
tr("command.inventorycheck.desc"),
CommandPermissionLevel::GameDirectors
);
ll::service::getCommandRegistry()->registerAlias("inventorycheck", "ic");
cmd.overload().execute<[&](CommandOrigin const& origin, CommandOutput& output) {
auto entity = (GMLIB_Actor*)origin.getEntity();
if (entity && entity->isPlayer()) {
auto pl = (Player*)entity;
return mainForm(*pl);
}
return output.error(tr("command.error.console"));
}>();
cmd.overload().execute([](CommandOrigin const& origin, CommandOutput& output) {
auto entity = (gmlib::GMActor*)origin.getEntity();
if (entity && entity->isPlayer()) {
auto pl = (Player*)entity;
return mainForm(*pl);
}
return output.error(tr("command.error.console"));
});
}