Improve trading villager selection based on profession

This commit is contained in:
2021-05-01 21:31:21 +00:00
parent 080895421d
commit a87cc85eab
9 changed files with 82 additions and 15 deletions
+7
View File
@@ -393,6 +393,13 @@ class Game:
obj.item_id = entry.value.item_id
obj.item_count = entry.value.item_count
mob = self.g.mobs.get(packet.entity_id, None)
if mob:
for entry in packet.metadata:
if mob.type == mobs.VILLAGER:
if entry.index == 17:
mob.profession = entry.value[1]
player = self.g.players.get(packet.entity_id, None)
if player:
return