mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
New folder & better copyassetstoclient
This commit is contained in:
parent
79ec8fb439
commit
4c4ff349a0
|
|
@ -30,23 +30,32 @@ if dest_common.exists():
|
||||||
# shutil.rmtree(client_build_dir / "DurangoMedia", ignore_errors=True)
|
# shutil.rmtree(client_build_dir / "DurangoMedia", ignore_errors=True)
|
||||||
|
|
||||||
# copy `Minecraft.Assets/Common` into the build directory for the client.
|
# copy `Minecraft.Assets/Common` into the build directory for the client.
|
||||||
shutil.copytree(
|
try:
|
||||||
src_assets / "Common",
|
shutil.copytree(
|
||||||
dest_common,
|
src_assets / "Common",
|
||||||
)
|
dest_common,
|
||||||
|
)
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f"Error: source Common directory not found: {src_assets / 'Common'}", file=sys.stderr)
|
||||||
|
raise
|
||||||
|
|
||||||
# copy the media archive to `Common/Media` inside the folder we just copied.
|
# copy the media archive to `Common/Media` inside the folder we just copied.
|
||||||
shutil.copy(media_archive, client_build_dir / "Common" / "Media")
|
shutil.copy(media_archive, client_build_dir / "Common" / "Media")
|
||||||
|
|
||||||
# copy music and Sound with updated paths because putting them in root looks ugly.
|
# copy Sound with updated paths because putting them in root looks ugly.
|
||||||
shutil.copytree(
|
|
||||||
src_assets / "Common" / "Music",
|
sound_src = src_assets / "DurangoMedia" / "Sound"
|
||||||
dest_common / "Music"
|
sound_dst = dest_common / "Sound"
|
||||||
)
|
if sound_src.exists():
|
||||||
shutil.copytree(
|
if sound_dst.exists():
|
||||||
src_assets / "DurangoMedia" / "Sound",
|
print(f"Info: destination {sound_dst} already exists; skipping sound copy", file=sys.stderr)
|
||||||
dest_common / "Sound"
|
else:
|
||||||
)
|
try:
|
||||||
|
shutil.copytree(sound_src, sound_dst)
|
||||||
|
except FileExistsError:
|
||||||
|
print(f"Info: race: {sound_dst} already exists; skipping sound copy", file=sys.stderr)
|
||||||
|
else:
|
||||||
|
print(f"Warning: sound source {sound_src} not found!!", file=sys.stderr)
|
||||||
|
|
||||||
# copy DLC
|
# copy DLC
|
||||||
# XXX: The DLC path is handled inside of 4JLibs, the Windows64 build expects `DurangoMedia/DLC` to load DLC data from
|
# XXX: The DLC path is handled inside of 4JLibs, the Windows64 build expects `DurangoMedia/DLC` to load DLC data from
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue