Skip to content

Comments

feat: 增加世界区域解析#5503

Closed
XiaotianNB666 wants to merge 24 commits intoHMCL-dev:mainfrom
XiaotianNB666:main
Closed

feat: 增加世界区域解析#5503
XiaotianNB666 wants to merge 24 commits intoHMCL-dev:mainfrom
XiaotianNB666:main

Conversation

@XiaotianNB666
Copy link

解决了Issue #5495 的部分问题

@XiaotianNB666
Copy link
Author

XiaotianNB666 commented Feb 9, 2026

我也不知道为什么
按错了键 把"//"注释全删了 后来才发现(

Copy link
Member

@burningtnt burningtnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怀疑本 PR 的必要性

}
}

public record WorldPath(Path worldPath, String worldType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Record 会由 javac 自动生成 getter, equals, hashCode 方法,无需二次定义

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我没看出这个文件里有任何实质性的更改,请还原。

* @author Xiaotian
* @see <a href="https://minecraft.wiki/w/Region_file_format">The Region file format</a>
*/
public static class WorldParser {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所以你声明了一个新的工具类,那你会准备如何将向用户呈现他们呢?我没看到相关 UI 内容

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本来有UI的,但由于 未打磨完毕且性能着实不高 先延后了

我对此做出以下说明:

  1. UI还需打磨(这是写的示例UI,非游戏文件读取)
4df7d2bd4cfd89c02a061d7dd41bcd0a 2.我忘记转为 Draft 了

@XiaotianNB666 XiaotianNB666 marked this pull request as draft February 9, 2026 11:42
@Mine-diamond
Copy link
Contributor

和我的计划有冲突(。>︿<)_θ,我打算实现区块读取和存储的(为NBT editor #5095),不过应该没有这个深入?我的现在计划是按我的原计划继续写,最后再看看如何处理,是保留两个不同的类还是合并。

@XiaotianNB666
Copy link
Author

XiaotianNB666 commented Feb 10, 2026 via email

@@ -203,8 +203,11 @@ private Color getColor(@NotNull String blockName) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有几个问题我没法擅自做主:
1.究竟是给整个区块上色,还是给每个方块都上色
2.方块颜色究竟是在HMCL内部内置常用色表,还是从assets中读取后取色,或者两种方案融合

}

public void renderMainLoop(){
while (isRendering()) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里好像死锁了:(
明天吧......

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不对,是把UI线程阻塞了
明天改:(

}

// Configure coordinate label style
coordinateLabel.setStyle("-fx-font-size: 14px; -fx-text-fill: white; -fx-background-color: rgba(0,0,0,0.7);");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

将会接入HMCL SheetStyle
但现在不考虑

@XiaotianNB666
Copy link
Author

功能演示
https://github.com/user-attachments/assets/dd890e55-ba82-4d7b-8cde-7a518eacbdc8

下一步: 获得最高的非空气方块

@XiaotianNB666
Copy link
Author

image

补充: 可以渲染出地貌(y=60)

@zkitefly
Copy link
Member

image 补充: 可以渲染出地貌(y=60)

我建议 UI 可以独立显示在一个窗口,就像 游戏非正常退出 捕捉窗口那样

@XiaotianNB666
Copy link
Author

XiaotianNB666 commented Feb 11, 2026 via email

@XiaotianNB666
Copy link
Author

XiaotianNB666 commented Feb 11, 2026

说真的,加载速度很ok了
只要把队列做好,不可视的待加载区块移除出队列,响应就会更快
https://github.com/user-attachments/assets/0688c186-07ce-4d71-92f2-5f466605d634
不会有人寻找HMCL的 距离现象

@XiaotianNB666
Copy link
Author

XiaotianNB666 commented Feb 12, 2026

喜报!
由于以下原因现已放弃对此PR和对Issue #5495的开发。

  1. 最主要的: 将世界编辑/预览内置HMCL带来的好处确实有限,且开发成本较高。不如让用户下载外部工具。
  2. 由于技术原因,性能瓶颈始终无法突破。要么CPU占用高,要么吃了我4个G内存啊......
  3. 有新的开发想法了

@XiaotianNB666
Copy link
Author

现 两个分支如下:

  1. 旧World Parser(占CPU) https://github.com/XiaotianNB666/HMCL-dev/tree/main-new-world-parser-dev
  2. 新World Parser(占 内存) https://github.com/XiaotianNB666/HMCL-dev/tree/main-old-world-parser-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants