Fix hidden item metadata bug
This commit is contained in:
@@ -113,7 +113,10 @@ class ChatManager:
|
||||
elif 'text' in data:
|
||||
return data['text']
|
||||
elif 'with' in data:
|
||||
return '<{}> {}'.format(*[self.translate_chat(x) for x in data['with']])
|
||||
if len(data['with']) >= 2:
|
||||
return '<{}> {}'.format(*[self.translate_chat(x) for x in data['with']])
|
||||
else:
|
||||
return self.translate_chat(data['with'][0])
|
||||
elif 'translate' in data:
|
||||
return data['translate']
|
||||
else:
|
||||
@@ -127,6 +130,7 @@ class ChatManager:
|
||||
print('[%s] %s'%(source, text))
|
||||
except Exception as ex:
|
||||
print('Exception %r on message (%s): %s' % (ex, chat_packet.field_string('position'), chat_packet.json_data))
|
||||
return
|
||||
|
||||
if self.handler:
|
||||
self.handler((source, text))
|
||||
|
@@ -142,9 +142,11 @@ class Entry(Type):
|
||||
1: VarInt,
|
||||
2: Float,
|
||||
3: String,
|
||||
5: Boolean,
|
||||
6: Slot,
|
||||
7: Boolean,
|
||||
9: Position,
|
||||
18: VarInt,
|
||||
}
|
||||
|
||||
def __init__(self, index, type, value):
|
||||
|
Reference in New Issue
Block a user