python中的terria世界解析器
lihzahrd的Python项目详细描述
lihzahrd
python中的terraria 1.3.5.3世界解析器。
您可以使用这个包从Terraria世界中获取程序员友好的数据!
安装时使用:
pip install lihzahrd
用法
您可以通过调用:
import lihzahrd
world = lihzahrd.World.create_from_file("filename.wld")
它将需要一段时间来处理:一个小小的Terraria世界包含超过500万块瓷砖!
一旦有了World
对象,就可以通过访问its attributes来使用保存文件中的所有数据。
文档
文档是可用的here。
这有点混乱和不完整,因为我还没有弄清楚一些数据的含义,代码需要一些重构。
如果您知道文档中没有的内容,请告诉我with an issue!
使用的参考资料
- TEdit World Parser,目前最精确的来源。
- tModLoader wiki,包含所有可能id的列表。
- Terrafirma world documentation,精确到旧世界(版本<;69)
- 1.3.x.x world documentation,有点不完整,但仍然是一个有用的来源。
- github上的JS World Parser。
- 显示所有可能的世界背景的蒸汽上的Background Guide。
许可证
lihzahrd
是根据AGPL 3.0授权的。
这意味着您必须在同一许可证下发布使用lihzahrd
创建的任何程序的源代码。
另请参见
- flyingsnake,使用此包的地图渲染器