|
19 | 19 | #include "main/Configs.h" |
20 | 20 | #include "mc/_HeaderOutputPredefine.h" |
21 | 21 | #include "mc/codebuilder/MCRESULT.h" |
| 22 | +#include "mc/common/wrapper/GenerateMessageResult.h" |
22 | 23 | #include "mc/deps/json/JsonHelpers.h" |
23 | 24 | #include "mc/enums/CurrentCmdVersion.h" |
24 | 25 | #include "mc/locale/I18n.h" |
@@ -113,7 +114,9 @@ Local<Value> convertResult(DynamicCommand::Result const& result) { |
113 | 114 | return FloatPos::newPos(result.get<Vec3>(), dim ? (int)dim->getDimensionId() : -1); |
114 | 115 | } |
115 | 116 | case DynamicCommand::ParameterType::Message: |
116 | | - return String::newString(result.getRaw<CommandMessage>().getMessage(*result.origin)); |
| 117 | + return String::newString( |
| 118 | + result.getRaw<CommandMessage>().generateMessage(*result.origin, CommandVersion::CurrentVersion).string |
| 119 | + ); |
117 | 120 | case DynamicCommand::ParameterType::RawText: |
118 | 121 | return String::newString(result.getRaw<std::string>()); |
119 | 122 | case DynamicCommand::ParameterType::JsonValue: |
@@ -470,7 +473,10 @@ void onExecute( |
470 | 473 | auto cmd = CommandClass::newCommand(const_cast<DynamicCommandInstance*>(instance)); |
471 | 474 | auto ori = CommandOriginClass::newCommandOrigin(&origin); |
472 | 475 | auto outp = CommandOutputClass::newCommandOutput(&output); |
473 | | - for (auto& [name, param] : results) args.set(name, convertResult(param)); |
| 476 | + for (auto& [name, param] : results) { |
| 477 | + lse::getSelfPluginInstance().getLogger().info(param.toDebugString()); |
| 478 | + args.set(name, convertResult(param)); |
| 479 | + } |
474 | 480 | localShareData->commandCallbacks[commandName].func.get().call({}, cmd, ori, outp, args); |
475 | 481 | } |
476 | 482 | CATCH_WITHOUT_RETURN("Fail in executing command \"" + commandName + "\"!") |
|
0 commit comments