2021-04-19 11:10:33 -07:00
|
|
|
from requests import get
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
def download(url, name):
|
|
|
|
with open(name, "wb+") as f:
|
|
|
|
response = get(url)
|
|
|
|
f.write(response.content)
|
|
|
|
|
|
|
|
def check_sound_and_download(url, name):
|
|
|
|
if not Path(name).exists():
|
2021-07-20 12:49:54 -07:00
|
|
|
print("File \"%s\" doesn't exist, let's download it." % name)
|
2021-04-19 11:10:33 -07:00
|
|
|
download(url, name)
|
|
|
|
else:
|
|
|
|
print("File \"%s\" already exists." % name)
|
|
|
|
|
|
|
|
def main():
|
|
|
|
print("Fetching assets...")
|
|
|
|
|
|
|
|
# calm1 through calm3
|
|
|
|
for i in range(1,4):
|
2021-08-12 05:23:32 -07:00
|
|
|
check_sound_and_download("https://betacraft.pl/MinecraftResources/music/calm%s.ogg" % i, Path("mods/mcnt_music/sounds/calm%s.ogg" % i))
|
2021-04-19 11:10:33 -07:00
|
|
|
|
|
|
|
# piano1 through piano3
|
|
|
|
for i in range(1,4):
|
2021-08-12 05:23:32 -07:00
|
|
|
check_sound_and_download("https://betacraft.pl/MinecraftResources/newmusic/piano%s.ogg" % i, Path("mods/mcnt_music/sounds/piano%s.ogg" % i))
|
2021-04-19 11:10:33 -07:00
|
|
|
|
2021-07-20 12:49:54 -07:00
|
|
|
# step sounds
|
|
|
|
step_sounds = [ 'cloth', 'grass', 'gravel', 'sand', 'snow', 'stone', 'wood' ]
|
|
|
|
for step_sound in step_sounds:
|
|
|
|
for i in range(1,5):
|
2021-11-26 06:45:10 -08:00
|
|
|
check_sound_and_download("https://betacraft.pl/MinecraftResources/newsound/step/%s%s.ogg" % (step_sound, i), Path("mods/mcnt_core/sounds/%s.%s.ogg" % (step_sound, i)))
|
2021-07-20 12:49:54 -07:00
|
|
|
|
2021-07-23 13:19:59 -07:00
|
|
|
# item pickup sound
|
|
|
|
check_sound_and_download("https://betacraft.pl/MinecraftResources/newsound/random/pop.ogg", Path("mods/mcnt_itemdrop/sounds/pop.ogg"))
|
|
|
|
|
2021-04-19 11:10:33 -07:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|