Add BigReactors 0.4.2A2

This commit is contained in:
Andrew Miner
2015-03-13 21:52:55 -07:00
parent 8894124520
commit c9ab80e7ab
92 changed files with 4338 additions and 19 deletions
+19 -19
View File
@@ -1,7 +1,7 @@
#!/bin/bash
USAGE=<<-END
USAGE: convert-nei-dump <source> <target>
read -d '' USAGE <<END
USAGE: convert-nei-dump <source> <mod_slug> <mod_version>
Converts output from NEI dump files into a format which can be used by
Crafting Guide. In particlar, this script looks for the "Item Panel" dump
@@ -12,37 +12,37 @@ USAGE: convert-nei-dump <source> <target>
recipes for each item: only their names. Once this script has converted the
data, you will need to manually enter the missing content.
<source> : the "dumps" directory where NEI dropped its content
<target> : the mod version directory where the finished files should
be placed
<source> : the "dumps" directory where NEI dropped its content
<mod_slug> : the slug of the mod being converted
<mod_version> : the version of the mod being converted
END
function die {
echo $1
exit 1
}
SOURCE_DIR="$1"; shift
TARGET_DIR="$1"; shift
DATA_FILE="$TARGET_DIR/mod-version.cg"
MOD_SLUG="$1"; shift
MOD_VERSION="$1"; shift
if [[ "$SOURCE_DIR" == "" || "$TARGET_DIR" == "" ]]; then
echo $USAGE
die
mkdir -p "./static/data/$MOD_SLUG/$MOD_VERSION"
DATA_FILE="./static/data/$MOD_SLUG/$MOD_VERSION/mod-version.cg"
touch "$DATA_FILE"
if [[ "$SOURCE_DIR" == "" || "$MOD_SLUG" == "" || "$MOD_VERSION" == "" ]]; then
echo "$USAGE"
exit 1
fi
mkdir -p $TARGET_DIR/images
mkdir -p "./static/browse/$MOD_SLUG/images"
ls $SOURCE_DIR/itempanel_icons | while read FILE; do
ITEM_NAME="$(echo $FILE | sed 's/.png//')"
TARGET_FILE="$(echo $ITEM_NAME \
ITEM_SLUG="$(echo $ITEM_NAME \
| sed 's/[^a-zA-Z0-9]/_/g' \
| sed 's/__*/_/g' \
| sed 's/^_//' \
| sed 's/_$//' \
| tr '[A-Z]' '[a-z]' \
).png"
cp "$SOURCE_DIR/itempanel_icons/$FILE" "$TARGET_DIR/images/$TARGET_FILE"
)"
mkdir -p "./static/browse/$MOD_SLUG/$ITEM_SLUG"
cp "$SOURCE_DIR/itempanel_icons/$FILE" "./static/browse/$MOD_SLUG/$ITEM_SLUG/icon.png"
if ! grep -q "item: $ITEM_NAME$" $DATA_FILE; then
echo "item: $ITEM_NAME" >> $DATA_FILE
echo "" >> $DATA_FILE