Spigot-Plugin to make every Player have shared hearts, tracking both damage and healing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
966 B

2 years ago
#!/usr/bin/env python3
import requests
3 years ago
import sys
3 years ago
def get_paper(version, destination):
print(f"Trying to fetch {version} into {destination}")
3 years ago
base = "https://papermc.io/api/v2/projects/paper/versions"
r = requests.get(f"{base}/{version}")
if not r.ok:
print(f"Cannot find version {version}, aborting.")
return
3 years ago
build = max(r.json()['builds'])
r = requests.get(f"{base}/{version}/builds/{build}")
3 years ago
download = r.json()['downloads']['application']['name']
content = requests.get(f"{base}/{version}/builds/{build}/downloads/{download}").content
with open(destination, "wb") as jarFile:
jarFile.write(content)
def main(argv):
if len(argv) == 1:
print("No version defined!")
return
version = argv[1]
if len(argv) == 2:
destination = "paper.jar"
else:
destination = argv[2]
get_paper(version, destination)
if __name__ == "__main__":
main(sys.argv)