only add metrics if the advancements exists
This commit is contained in:
parent
2ae69d73f8
commit
aa55190637
1 changed files with 15 additions and 10 deletions
|
@ -234,14 +234,19 @@ class MinecraftCollector(object):
|
|||
player_quests_finished.add_sample('player_quests_finished',value=value,labels={'player':name})
|
||||
|
||||
if "stats" in data: # Minecraft > 1.15
|
||||
if "minecraft:crafted" in data["stats"]:
|
||||
for block, value in data["stats"]["minecraft:crafted"].items():
|
||||
blocks_crafted.add_sample('blocks_crafted',value=value,labels={'player':name,'block':block})
|
||||
if "minecraft:mined" in data["stats"]:
|
||||
for block, value in data["stats"]["minecraft:mined"].items():
|
||||
blocks_mined.add_sample("blocks_mined",value=value,labels={'player':name,'block':block})
|
||||
if "minecraft:picked_up" in data["stats"]:
|
||||
for block, value in data["stats"]["minecraft:picked_up"].items():
|
||||
blocks_picked_up.add_sample("blocks_picked_up",value=value,labels={'player':name,'block':block})
|
||||
if "minecraft:killed" in data["stats"]:
|
||||
for entity, value in data["stats"]["minecraft:killed"].items():
|
||||
entities_killed.add_sample('entities_killed',value=value,labels={'player':name,"entity":entity})
|
||||
if "minecraft:killed_by" in data["stats"]:
|
||||
for entity, value in data["stats"]["minecraft:killed_by"].items():
|
||||
player_deaths.add_sample('player_deaths',value=value,labels={'player':name,'cause': entity})
|
||||
for stat, value in data["stats"]["minecraft:custom"].items():
|
||||
|
|
Loading…
Reference in a new issue