Compare commits

...

9 Commits

Author SHA1 Message Date
Geoff Bourne
b5bb0e8e9f Combine stderr 2022-01-26 20:07:05 -06:00
Geoff Bourne
825006f945 Use docker-compose 2022-01-26 20:00:23 -06:00
Geoff Bourne
07cfcb08a1 Without --quiet-pull 2022-01-26 19:54:27 -06:00
Floyd Everest
11f25d3179 reimplemented crafting tweaks 2022-01-25 13:21:03 +11:00
Floyd Everest
cba57b2f56 Re-updated README.md to include my crafting tweaks 2022-01-25 13:17:59 +11:00
Floyd Everest
4a36200d0c take three at reverting readme.... 2022-01-25 13:16:26 +11:00
Floyd Everest
d5114b3c7f revert changes to readme 2022-01-25 13:08:45 +11:00
Floyd Everest
965729a87d Revert "added crafting tweaks functionality to vanillatweaks json method"
This reverts commit 286c104bdc.
2022-01-25 13:05:21 +11:00
Floyd Everest
286c104bdc added crafting tweaks functionality to vanillatweaks json method 2022-01-24 15:41:54 +11:00
3 changed files with 34 additions and 10 deletions

View File

@@ -899,6 +899,12 @@ Example of expected Vanillatweaks file format:
"coordinates hud"
],
"items": ["armored elytra"]
},
"craftingtweaks": {
"quality of life": [
"rotten flesh to leather",
"back to blocks"
]
}
}
```

View File

@@ -33,7 +33,7 @@ if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
fi
fi
# Use vanillatweaks file to specify VT and datapacks
# Use vanillatweaks file to specify VT and datapacks and crafting tweaks
if [[ "$VANILLATWEAKS_FILE" ]]; then
if [ ! -f "$VANILLATWEAKS_FILE" ]; then
log "ERROR: given VANILLATWEAKS_FILE file does not exist"
@@ -41,8 +41,10 @@ if [[ "$VANILLATWEAKS_FILE" ]]; then
fi
PACKS=$(jq -jc '.packs' $VANILLATWEAKS_FILE)
if [ ! "$PACKS" ]; then
log "ERROR: unable to retrieve packs from $VANILLATWEAKS_FILE"
CRAFTING_TWEAKS=$(jq -jc '.craftingtweaks' $VANILLATWEAKS_FILE)
if [ ! "$PACKS" ] && [ ! "$CRAFTING_TWEAKS" ]; then
log "ERROR: unable to retrieve packs or crafting tweaks from $VANILLATWEAKS_FILE"
exit 2
fi
@@ -58,19 +60,19 @@ if [[ "$PACKS" ]] && [[ "$VT_VERSION" ]]; then
VT_ZIPDATA_URL=https://vanillatweaks.net/assets/server/zipdatapacks.php
DOWNLOAD_URL=$(curl -X POST -F "packs=${PACKS}" -F "version=${VT_VERSION}" $VT_ZIPDATA_URL | jq -r '.link')
if [ ! "$DOWNLOAD_URL" ]; then
log "ERROR: unable to retrieve DOWNLOAD_URL from vanillatweaks.net!"
log "ERROR: unable to retrieve datapack DOWNLOAD_URL from vanillatweaks.net!"
exit 2
fi
TEMPZIP=/tmp/vanillatweaks.zip
if ! get -o $TEMPZIP "https://vanillatweaks.net${DOWNLOAD_URL}"; then
log "ERROR: failed to download from ${DOWNLOAD_URL}"
if ! get -o $TEMPZIP "https://vanillatweaks.net${DOWNLOAD_URL}"; then
log "ERROR: failed to download datapacks from ${DOWNLOAD_URL}"
exit 2
fi
mkdir -p "$out_dir"
if ! unzip -o -d "$out_dir" $TEMPZIP; then
log "ERROR: failed to unzip the ${PACKS} from ${$TEMPZIP}"
log "ERROR: failed to unzip the datapacks ${PACKS} from ${$TEMPZIP}"
fi
# clean up files time!
@@ -81,4 +83,20 @@ if [[ "$PACKS" ]] && [[ "$VT_VERSION" ]]; then
fi
fi
# Download and move crafting tweaks
if [[ "$CRAFTING_TWEAKS" ]] && [[ "$VT_VERSION" ]]; then
VT_ZIPDATA_URL=https://vanillatweaks.net/assets/server/zipcraftingtweaks.php
DOWNLOAD_URL=$(curl -X POST -F "packs=${CRAFTING_TWEAKS}" -F "version=${VT_VERSION}" $VT_ZIPDATA_URL | jq -r '.link')
if [ ! "$DOWNLOAD_URL" ]; then
log "ERROR: unable to retrieve crafting tweak DOWNLOAD_URL from vanillatweaks.net!"
exit 2
fi
mkdir -p "$out_dir"
if ! get -o $out_dir/crafting_tweaks.zip "https://vanillatweaks.net${DOWNLOAD_URL}"; then
log "ERROR: failed to download crafting tweaks from ${DOWNLOAD_URL}"
exit 2
fi
fi
exec "${SCRIPTS:-/}start-setupDatapack" "$@"

View File

@@ -11,8 +11,8 @@ setupOnlyMinecraftTest(){
cd "$folder"
result=0
if ! logs=$(docker compose run --quiet-pull mc 2>&1); then
echo "${folder} setup FAILED"
if ! logs=$(docker-compose run mc 2>&1); then
echo "${folder} test scenario FAILED"
echo ":::::::::::: LOGS ::::::::::::::::
$logs
::::::::::::::::::::::::::::::::::
@@ -29,7 +29,7 @@ $logs
echo "${folder} PASS"
fi
docker compose down -v --remove-orphans
docker-compose down -v --remove-orphans
cd ..
return $result