Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLSE的onCmdBlockExecute事件isMinecart值总为true #923

Closed
Yuisyuu opened this issue Dec 3, 2022 · 0 comments · Fixed by #924
Closed

LLSE的onCmdBlockExecute事件isMinecart值总为true #923

Yuisyuu opened this issue Dec 3, 2022 · 0 comments · Fixed by #924
Labels
bug Related to software malfunction priority: high Needs prompt action
Milestone

Comments

@Yuisyuu
Copy link

Yuisyuu commented Dec 3, 2022

异常模块

ScriptEngine (脚本引擎)

操作系统

Windows Server 2022

LiteLoader 版本

2.9.0 Actions#54 a5eaf62

BDS 版本

1.19.50.02

发生了什么?

LLSE的onCmdBlockExecute事件isMinecart值总为true
https://github.com/LiteLDev/LiteLoaderBDS/blob/a5eaf6290b0f3836075098148e2a5131746c4f25/ScriptEngine/src/api/EventAPI.cpp#L763-L770

理想状态

if (ev.mIsMinecart) {
    CallEvent(EVENT_TYPES::onCmdBlockExecute, String::newString(ev.mCommand),
              FloatPos::newPos(ev.mMinecart->getPosition(), ev.mMinecart->getDimensionId()), ev.mIsMinecart);
} else {
    BlockInstance bl = ev.mBlockInstance;
    CallEvent(EVENT_TYPES::onCmdBlockExecute, String::newString(ev.mCommand),
              FloatPos::newPos(bl.getPosition().toVec3(), bl.getDimensionId()), ev.mIsMinecart);
}

复现此问题的步骤

  1. 注册onCmdBlockExecute的监听器
  2. 命令方块执行命令
  3. 查看第三个回调值

有关的日志/输出

无关

插件列表

无关
@ShrBox ShrBox added bug Related to software malfunction status: to do priority: high Needs prompt action labels Dec 3, 2022
@ShrBox ShrBox closed this as completed in 0dd004a Dec 3, 2022
@Jasonzyt Jasonzyt mentioned this issue Dec 3, 2022
8 tasks
@Jasonzyt Jasonzyt added this to the 2.9.0 milestone Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Related to software malfunction priority: high Needs prompt action
Development

Successfully merging a pull request may close this issue.

3 participants