Fix version rendering if minecraft version is not found in minecraft-data
This commit is contained in:
parent
e87c1b7203
commit
4679909010
|
@ -123,7 +123,11 @@ def paper_version():
|
||||||
status = server_status()
|
status = server_status()
|
||||||
paper_version = status.version.name
|
paper_version = status.version.name
|
||||||
protocol_version = status.version.protocol
|
protocol_version = status.version.protocol
|
||||||
mc_version = list(filter(lambda x: x.get("version", 0) == protocol_version, minecraft_data.common().protocolVersions))[0].get("minecraftVersion", "Unknown")
|
possible_versions = list(filter(lambda x: x.get("version", 0) == protocol_version, minecraft_data.common().protocolVersions))
|
||||||
|
try:
|
||||||
|
mc_version = possible_versions[0].get("minecraftVersion", "Unknown")
|
||||||
|
except:
|
||||||
|
mc_version = "Unknown"
|
||||||
return {"paper": paper_version, "minecraft": mc_version}
|
return {"paper": paper_version, "minecraft": mc_version}
|
||||||
|
|
||||||
def datapack_info():
|
def datapack_info():
|
||||||
|
|
Loading…
Reference in a new issue