Fix mcstatus version compatibility
This commit is contained in:
parent
4679909010
commit
b8d9f708ed
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
from mcstatus import MinecraftServer
|
||||
from mcstatus import JavaServer
|
||||
from os.path import join as pathjoin
|
||||
from bottle import route, run, static_file, template
|
||||
from random import random, choice
|
||||
|
@ -153,8 +153,12 @@ def server_details():
|
|||
return {"hardware": hardware, "versions": versions, "datapacks": datapacks}
|
||||
|
||||
def server_status():
|
||||
server = MinecraftServer.lookup(CONFIG["mcrcon"]["host"])
|
||||
status = server.status()
|
||||
server = JavaServer.lookup(CONFIG["mcrcon"]["host"])
|
||||
try:
|
||||
status = server.status()
|
||||
except ConnectionRefusedError:
|
||||
status = "UNKNOWN"
|
||||
|
||||
return status
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue