You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this library is still maintained. Either way, I have a monkey patch that allows Block.from_palette() (and functions that call it like Chunk.get_block()) to work with Minecraft 26.3 .mca files:
importanvil, nbt# Minecraft 26.3 added 3 new formats for storing a block's name. The old format# still appears in blocks that haven't been loaded since the update, for a total# of 4 possible formats@classmethoddefanvil_Block_from_palette_override(cls,
tag: nbt.TAG_Compound|nbt.TAG_String):
# After 26.3 section palettes in which all blocks are in default state now# use plain string tags instead of compound tagsiftype(tag) ==nbt.nbt.TAG_String:
returncls.from_name(tag.value)
# After 26.3 block which are in default state but not in a plain string# section use "" inseat of "Name" and omit "Properties"if''intag:
returncls.from_name(tag[''].value)
# After 26.3 block which are not in default state use "id" instead of "Name"# and "properties" instead of "Properties"if'id'intag:
returncls.from_name(tag['id'].value,
properties=dict(tag.get('properties', dict())))
# Pre-26.3 formatif'Name'intag:
returncls.from_name(tag['Name'].value,
properties=dict(tag.get('Properties', dict())))
raiseNotImplementedError('Block format not recognized - did Minecraft add ''a new one?')
anvil.Block.from_palette=anvil_Block_from_palette_override
I haven't tested for backwards compatibility, but if this library is still maintained I could send a PR.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Not sure if this library is still maintained. Either way, I have a monkey patch that allows Block.from_palette() (and functions that call it like Chunk.get_block()) to work with Minecraft 26.3 .mca files:
I haven't tested for backwards compatibility, but if this library is still maintained I could send a PR.
All reactions