一个简单的nbtlib原理图文件读取器
nbtschematic的Python项目详细描述
nbt血样
A simple nbtlib Schema for reading or writing Schematic files for MCEdit and other world editors.
安装
Python3.6或更高版本是必需的。
pip3 install nbtschematic
示例
从磁盘加载现有的MCEDIT或其他示意文件,运行:
fromnbtschematicimportSchematicFilesf=SchematicFile.load('tests/test_schematic/simple.schematic')print("The block at Y=%d, Z=%d, X=%d has block ID %d"%(2,3,0,sf.blocks[2,3,0]))
要在python中生成原理图文件,请运行:
fromnbtschematicimportSchematicFilesf=SchematicFile(shape=(10,8,4))assertsf.blocks.shape==(10,8,4)sf.blocks[2,3,0]=42sf.save('example.schematic')
示意图的尺寸应在施工时确定。调整大小 将清除块和块数据。
其他感兴趣的领域包括:
data
:每个块的块数据entities
:不是块的所有内容blockentities
:块的扩展元数据
进一步阅读
有关底层对象的更多信息,请参见nbtlib
examples
网页
许可证-MIT