在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):matcool/anvil-parser开源软件地址(OpenSource Url):https://github.com/matcool/anvil-parser开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):anvil-parserSimple parser for the Minecraft anvil file format InstallationThis project is available on PyPI and can be installed with pip
or directly from github
UsageReadingimport anvil
region = anvil.Region.from_file('r.0.0.mca')
# You can also provide the region file name instead of the object
chunk = anvil.Chunk.from_region(region, 0, 0)
# If `section` is not provided, will get it from the y coords
# and assume it's global
block = chunk.get_block(0, 0, 0)
print(block) # <Block(minecraft:air)>
print(block.id) # air
print(block.properties) # {} Making own regionsimport anvil
from random import choice
# Create a new region with the `EmptyRegion` class at 0, 0 (in region coords)
region = anvil.EmptyRegion(0, 0)
# Create `Block` objects that are used to set blocks
stone = anvil.Block('minecraft', 'stone')
dirt = anvil.Block('minecraft', 'dirt')
# Make a 16x16x16 cube of either stone or dirt blocks
for y in range(16):
for z in range(16):
for x in range(16):
region.set_block(choice((stone, dirt)), x, y, z)
# Save to a file
region.save('r.0.0.mca') Todothings to do before 1.0.0
NoteTesting done in 1.14.4 and 1.15.2, should work fine for other versions. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论