Open nic96 opened 6 years ago
I found a quick fix by replacing:
id = defs_get(ids_get(v, 'Unknown'),
{'name': 'Unknown Entity %s' % v,
'idStr': 'Unknown Entity %s' % v,
'id': -1,
'type': 'Unknown'}
)['name']
With this:
invertEntities = {v: k for k, v in entity.PocketEntity.entityList.items()}
id = invertEntities.get(v, "Entity %s"%v)
#Add the built one to the entities
if id not in entity.PocketEntity.entityList.keys():
logger.warning("Found unknown entity '%s'"%v)
entity.PocketEntity.entityList[id] = v
In the following file: https://github.com/Podshot/MCEdit-Unified/blob/430a47934bb1c6f530eac60fc07dca246e90c9d8/pymclevel/leveldbpocket.py#L1959
I added the following code for debugging purposes:
try:
defs_get(ids_get(v, 'Unknown'),
{'name': 'Unknown Entity %s' % v,
'idStr': 'Unknown Entity %s' % v,
'id': -1,
'type': 'Unknown'}
)['name']
except KeyError, e:
defs = defs_get(ids_get(v, 'Unknown'),
{'name': 'Unknown Entity %s' % v,
'idStr': 'Unknown Entity %s' % v,
'id': -1,
'type': 'Unknown'}
)
for x in defs:
print x + " : " + str(defs[x])
print "\n"
And I get the following output.
Game Version: PE
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
data : {u'11': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Top)'}, u'10': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Top)'}, u'13': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Top)'}, u'12': {u'tex': [7, 0], u'name': u'Brick Slab (Top)'}, u'15': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Top)'}, u'14': {u'tex': [9, 13], u'name': u'Quartz Slab (Top)'}, u'1': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Bottom)'}, u'0': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Bottom)'}, u'3': {u'tex': [0, 1], u'name': u'Cobblestone Slab (Bottom)'}, u'2': {u'tex': [4, 0], u'aka': u'Old Wood', u'name': u'Wooden Slab (Bottom)'}, u'5': {u'tex': [6, 3], u'name': u'Stone Brick Slab (Bottom)'}, u'4': {u'tex': [7, 0], u'name': u'Brick Slab (Bottom)'}, u'7': {u'tex': [0, 14], u'name': u'Nether Brick Slab (Bottom)'}, u'6': {u'tex': [9, 13], u'name': u'Quartz Slab (Bottom)'}, u'9': {u'tex': [0, 12], u'tex_direction': {u'TOP': [0, 11], u'BOTTOM': [0, 13]}, u'name': u'Sandstone Slab (Top)'}, u'8': {u'tex': [5, 0], u'tex_direction': {u'TOP': [6, 0], u'BOTTOM': [6, 0]}, u'name': u'Stone Slab (Top)'}}
idStr : stone_slab
tex : [6, 0]
mapcolor : [200, 200, 200]
type : HALFHEIGHT
id : 44
And looking in the following file I see that stone_slab does indeed not have a name: https://github.com/Podshot/MCEdit-Unified/blob/87801cacde49cd7f2246d24d84473c41d9ef1b14/mcver/PE/blocks.json
And I'm not sure it should have a name or the code in pymclevel/leveldbpocket.py
just needs to be fixed.
Edit: If stone_slab should have a name then the fix is to just change:
"id": 44,
"idStr": "stone_slab",
"mapcolor": [
200,
200,
200
],
"tex": [
6,
0
],
"type": "HALFHEIGHT"
},
To this:
"id": 44,
"idStr": "stone_slab",
"mapcolor": [
200,
200,
200
],
"name": "Stone Slab",
"tex": [
6,
0
],
"type": "HALFHEIGHT"
},
Also red_flower
doesn't have a name. There might be more. I haven't checked. That's just what my code has come across so far.
Sorry for the delay answering but it seems weird to me... This only happens for entities so assuming the problem is that we're missing a name for a block doesn't make sense to me... Seems like id 44 for entities is zombie villager and when I use this id number, I get the zombie villager with the name tag... Can you try printing the "v" value in your debugging lines? Thanks!
Description of Issue: KeyError: 'name'
MCEdit Version: 87801ca
Minecraft Version the world was last opened in: PE 1.10.2
Operating System: Arch Linux
I get the following errors when loading a bedrock edition world:
And when trying to save I get:
So I'm able to open bedrock edition worlds, but unable to save.