Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
fixed runCmdEx
Browse files Browse the repository at this point in the history
  • Loading branch information
engsr6982 committed Apr 29, 2024
1 parent 9a22dd5 commit e0ce294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Api/RunCmdEx.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "Api.h"
#include "mc/locale/I18n.h"
#include "mc/locale/Localization.h"
#include "mc/server/commands/CommandOutput.h"


namespace tls::api {

RunCmdExOutput runCmdEx(const string& cmd) {
Expand All @@ -21,7 +24,9 @@ RunCmdExOutput runCmdEx(const string& cmd) {
if (command) {
command->run(origin, output);
for (auto msg : output.getMessages()) {
outputStr = outputStr.append(I18n::get(msg.getMessageId(), msg.getParams())).append("\n");
string tmp;
getI18n().getCurrentLanguage()->get(msg.getMessageId(), tmp, msg.getParams());
outputStr += tmp.append("\n");
}
if (output.getMessages().size()) {
outputStr.pop_back();
Expand Down
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
-- add_requires("levilamina develop") to use develop version
-- please note that you should add bdslibrary yourself if using dev version
add_requires(
"levilamina 0.11.0",
"levilamina 0.12.1",
"PermissionCore"
)

Expand Down

0 comments on commit e0ce294

Please sign in to comment.