From dd556115aa67a64559971cdb0401e4a17ed31805 Mon Sep 17 00:00:00 2001 From: sqozz Date: Tue, 23 Mar 2021 15:25:00 +0100 Subject: [PATCH] Add resource sources --- .gitignore | 2 ++ homepage/static/fonts/README.md | 1 + homepage/static/img/README.md | 2 ++ homepage/static/img/extract_resources.sh | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 .gitignore create mode 100644 homepage/static/fonts/README.md create mode 100644 homepage/static/img/README.md create mode 100755 homepage/static/img/extract_resources.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e56c987 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.png +*.ttf diff --git a/homepage/static/fonts/README.md b/homepage/static/fonts/README.md new file mode 100644 index 0000000..c055f1b --- /dev/null +++ b/homepage/static/fonts/README.md @@ -0,0 +1 @@ +Download https://www.dafont.com/de/minecraft.font and place it in here diff --git a/homepage/static/img/README.md b/homepage/static/img/README.md new file mode 100644 index 0000000..08f01c1 --- /dev/null +++ b/homepage/static/img/README.md @@ -0,0 +1,2 @@ +To not offend any copyright I have not included the needed resources into this repo. If you have minecraft installed on your PC you can simply use the `extract_resources.sh` script to grab the needed PNGs. It will choose the newest installation, extract the default resource pack and copy them in the folder you're running the script from. +Make sure to follow the instructions printed on screen. diff --git a/homepage/static/img/extract_resources.sh b/homepage/static/img/extract_resources.sh new file mode 100755 index 0000000..d44f49b --- /dev/null +++ b/homepage/static/img/extract_resources.sh @@ -0,0 +1,23 @@ +#!/bin/bash +RESOURCE_LOCATION=`ls -d ~/.minecraft/versions/1.* | tail -n 1` +RESOURCE_PACK=`ls $RESOURCE_LOCATION/*.jar` +echo "Resource pack located: $RESOURCE_PACK" +TMP_PATH=`mktemp -d` +echo -n "Copying and extracting resource packā€¦ " +cp $RESOURCE_PACK $TMP_PATH +pushd $TMP_PATH > /dev/null +unzip *.jar > /dev/null +echo "done!" +echo "Unzipped resources at $TMP_PATH" +popd + +FILES="birch_sign.png map.png redstone_lamp_on.png redstone_lamp.png writable_book.png" +for FILE in $FILES; do + echo -n "Grabbing asset from: " + find $TMP_PATH -name $FILE -print -exec cp {} . \; +done + +echo "Done grabbing resources!" +echo "" +echo "You can now copy the background blocks you wish to have from $TMP_PATH/assets/minecraft/textures/block/ into the background folder." +echo "Afterwards make sure to delete $TMP_PATH again to save disk space!"