网易我的世界论坛

标题: 运行测试模组时遇到一个错误报告求解答QAQ [打印本页]

作者: mclittleboat    时间: 2023-8-6 13:20
标题: 运行测试模组时遇到一个错误报告求解答QAQ
(网易版)错误报告如下:---------------------------Assert Failure - ctrl+C to copy this message to the clipboard!
---------------------------
Assertion failed: Structure element name already registered
Condition is false: mElementLookupMap.find(name) == mElementLookupMap.end()
Function: JigsawStructureElementRegistry::registerStructureElement in C:\jenkins_slave\workspace\SdkClientGit\git_minecraft\handheld\src\common\world\level\levelgen\structure\registry\JigsawStructureElementRegistry.cpp @ 15

---------------------------
确定   
---------------------------
我问了chatgpt,他说是结构注册错误,这是原话:这段代码中的条件 mElementLookupMap.find(name) == mElementLookupMap.end() 是一个断言断言,用于检查名为 name 的结构元素是否已经在 mElementLookupMap(一个数据结构)中注册。

mElementLookupMap.find(name) 表示在 mElementLookupMap 中查找名为 name 的结构元素。如果该结构元素存在,find 函数将返回指向该元素的迭代器;如果不存在,则返回 mElementLookupMap.end()。

因此,mElementLookupMap.find(name) == mElementLookupMap.end() 的比较表达式判断着这个结构元素是否已经在 mElementLookupMap 中被注册。如果返回结果为真(即等式成立),意味着结构元素没有被注册;否则,意味着结构元素已经注册过了。

在你的错误信息中,断言失败了,即结构元素 name 已经被注册过了,但是代码中却又尝试注册一次导致失败。这可能是一个潜在的 bug,你可能需要检查代码逻辑并确保正确注册结构元素。



请问我该怎么解决这个错误,或者这对我的MOD有没有什么影响,我做的是结构生成的MOD,用的是刚更新的大型结构和结构池,不知道结构还会不会继续生成,求大佬解答QAQ



作者: locgy    时间: 2023-8-7 10:29
Structure element name already registered
改名字试试?看起来好像是重名了。或者重启开发包试试?
不行换个存档。结构好像是跨存档的,还是可以导出来着,换存档也方便




欢迎光临 网易我的世界论坛 (https://mc.netease.com/) Powered by Discuz! X3.3