for ENTRY in `cat $JSON_FILE | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);' | grep music | awk -F\' '{print $2 "," $6}'`
do
echo "Processing $ENTRY..."
FILENAME=`echo $ENTRY | cut -d, -f1 | sed 's:.*/::'`
FILEHASH=`echo $ENTRY | cut -d, -f2`
#Locate the file in the assets directory structure
FULLPATH_HASHFILE=`find "$MINECRAFT_ASSETS_DIR" -name $FILEHASH`
#Copy the file
cp "$FULLPATH_HASHFILE" "$OUTPUT_DIR/$FILENAME"
done
Update the variables (e.g. MINECRAFT_ASSETS_DIR) with your correct directory paths
Run the script
旧版本的声音目录 (pre-1.7)
Edit
如果你的游戏版本在1.7.2以前,声音目录将如下:
Windows: %AppData%\.minecraft\assets 或 %AppData%\.minecraft\assets\virtual\legacy
Mac OS X: ~/Library/Application Support/minecraft/assets 或 ~/Library/Application Support/minecraft/assets/virtual/legacy
Linux: ~/.minecraft/assets 或 ~/.minecraft/assets/virtual/legacy
如果你同时有新旧两种版本,新版本与旧版本的声音文件都将存在。旧版本目录仅适用于 pre-1.7 版本。