mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-05 01:49:16 +00:00
reimplemented crafting tweaks
This commit is contained in:
parent
cba57b2f56
commit
11f25d3179
1 changed files with 25 additions and 7 deletions
|
@ -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" "$@"
|
||||
|
|
Loading…
Reference in a new issue