echo "# * minetestenv.rc started `date`" > "$err_txt"
customDie() {
echo
errorLevel=1
if [ -z "$2" ]; then
errorLevel=$2
fi
if [ -z "$1" ]; then
echo "Unknown error."
else
echo "ERROR:"
echo "$1" >> "$err_txt"
fi
echo "$1"
echo
echo "'$err_txt' may contain more information."
echo
echo "This session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit $errorLevel
}
CONFIG_PATH="$HOME/.config/EnlivenMinetest"
CACHE_PATH="$HOME/.cache/EnlivenMinetest"
@ -99,7 +130,6 @@ fi
#sleep 1
update_enable="true"
shell_name="bash"
err_txt=$HOME/err-enliven.txt
# doesn't work if equal: [ $0 = *"$shell_name"* ]
# could be -bash or bash
#if [ "$0" = "-bash" ]; then
@ -117,16 +147,7 @@ show_changes="true"
if [ "$SCRIPT" = "/bin/bash" ]; then
SCRIPT=minetestenv.rc
if [ ! -f "$SCRIPT" ]; then
echo "ERROR: could not find self (need location of self in order to get SCRIPTPATH and then REPO_PATH in order for patches directory to be found."
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo " 3..."
sleep 1
echo " 2..."
sleep 1
echo " 1..."
sleep 1
exit 1
customDie "ERROR: could not find self (need location of self in order to get SCRIPTPATH and then REPO_PATH in order for patches directory to be found."
fi
fi
# Absolute path this script is in, thus /home/user/bin
@ -138,7 +159,6 @@ show_changes="true"
PATCHES_PATH="$REPO_PATH/patches"
echo "PATCHES_PATH: $PATCHES_PATH"
sleep 10
if [ ! -d "$PATCHES_PATH" ]; then
# maybe moved somewhere or this code was pasted
@ -155,16 +175,7 @@ fi
if [ ! -d "$PATCHES_PATH" ]; then
echo
echo
echo "ERROR: could not find patches such as in $PATCHES_PATH"
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo " 3..."
sleep 1
echo " 2..."
sleep 1
echo " 1..."
sleep 1
exit 1
customDie "ERROR: could not find patches such as in $PATCHES_PATH"
fi
# NOTE: minetest mods (other than 0.4.16 client-side mods) are ALWAYS ONLY installed on server, unless you need them for singleplayer
echo " ERROR: failed to create $USR_SHARE_MINETEST/games/minetest_game, so cannot continue." > $err_txt
cat $err_txt
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo " 3..."
sleep 1
echo " 2..."
sleep 1
echo " 1..."
sleep 1
exit 1
customDie "failed to create $USR_SHARE_MINETEST/games/minetest_game, so cannot continue."
fi
else
echo "ERROR: refusing to reinstall minetest_game since missing sources (not at $HOME/minetest/games/minetest_game nor $HOME/Downloads/minetest/games/minetest_game"
echo "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_DEST_NAME' (1st param)--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
customDie "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_DEST_NAME' (1st param)"
fi
if [ -z "$MTMOD_GOT_NAME" ]; then
echo "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_GOT_NAME' which is the exact downloaded or unzipped folder name (2nd param)--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
customDie "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_GOT_NAME' which is the exact downloaded or unzipped folder name (2nd param)"
fi
if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
if [ ! -d "$MTMOD_GOT_NAME" ]; then
echo "ERROR: nothing done since add_mod_from_here FAILED to find '$MTMOD_GOT_NAME'--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
customDie "ERROR: nothing done since add_mod_from_here FAILED to find '$MTMOD_GOT_NAME'"
fi
if [ -d "$MTMOD_DEST_PATH" ]; then
if [ ! -f "`command -v rsync`" ]; then
echo "removing old $MTMOD_DEST_PATH"
sudo rm -Rf "$MTMOD_DEST_PATH"
rm -Rf "$MTMOD_DEST_PATH"
if [ -d "$MTMOD_DEST_PATH" ]; then
echo "FAILED to remove '$MTMOD_DEST_PATH'--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
customDie "FAILED to remove '$MTMOD_DEST_PATH'"
fi
fi
fi
if [ -d "$MTMOD_GOT_NAME" ]; then
# outer case is for safety in case variable is blank or something
echo " ERROR in remove_mod: failed to remove $MTMOD_DEST_PATH, so cannot continue." > $err_txt
cat $err_txt
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo " 3..."
sleep 1
echo " 2..."
sleep 1
echo " 1..."
sleep 1
exit 1
else
echo " [ - ] removed $MTMOD_DEST_PATH"
fi
@ -569,6 +508,7 @@ else
echo " local_enable: $local_enable"
fi
echo " USR_SHARE_MINETEST: $USR_SHARE_MINETEST"
echo " MT_MYGAMES_DIR: $MT_MYGAMES_DIR"
echo " MT_MYGAME_DIR: $MT_MYGAME_DIR"
echo " MT_WORLDS_DIR: $MT_WORLDS_DIR"
echo " MT_MYWORLD_NAME: $MT_MYWORLD_NAME"
@ -578,3 +518,4 @@ if [ ! -f "`command -v rsync`" ]; then
echo "The 'rsync' command was not found. Installing rsync will reduce writes to drive if you run install methods (as all use add_mod_from_here) more than once for the same mod."
# Mods were found at https://forum.minetest.net/viewforum.php?f=11
# (Ubuntu 14.04 Trusty Tahr Server) folders were found using:
# cd /
# sudo find -name 'worlds' (worlds folder is in $HOME/.minetest)
# sudo find -name 'minimal' (stable build [such as 0.4.9 games folder is /usr/share/games/minetest/games, but git version games folder is /usr/local/share/minetest/games)
# find -name 'worlds' (worlds folder is in $HOME/.minetest)
# find -name 'minimal' (stable build [such as 0.4.9 games folder is /usr/share/games/minetest/games, but git version games folder is /usr/local/share/minetest/games)
# ISSUES:
# * ERROR[Main]: Singleplayer mode says following mods could not be found: 3d_armor areas mobs mobs_animal mobs_monster protector technic treasurer unified_inventory xban2
#NOTE: map_generation_limit (aka world boundary, world border, or world limit) must be divisible by 64, so for example, 5000 results in invisible wall at 4928
#SPRINT_TIMEOUT = 0.5 --Only used if SPRINT_METHOD = 0
echo"bones_position_message = true" >> "$WRITEABLE_MINETEST_CONF"# default is false--this is for client-side chat message (server-side logging always on though)
echo"bones_position_message = true" >> "$MYGAME_MINETEST_CONF"# default is false--this is for client-side chat message (server-side logging always on though)
#no longer needed since these mods check for player_api to determine whether v3 model is used:
#TODO: below must go in the one in the subgame folder!
if["$version_0_5_enable"="true"];then
# echo "player_model_version = default_character_v3" >> "$WRITEABLE_MINETEST_CONF" # formerly used by playeranim
echo"playeranim.model_version = MTG_4_Nov_2017" >> "$WRITEABLE_MINETEST_CONF"# used by playeranim
# echo "player_model_version = default_character_v3" >> "$MYGAME_MINETEST_CONF" # formerly used by playeranim
echo"playeranim.model_version = MTG_4_Nov_2017" >> "$MYGAME_MINETEST_CONF"# used by playeranim
echo"using version 5 branch of mods..."
else
# echo "player_model_version = default_character_v2" >> "$WRITEABLE_MINETEST_CONF" # formerly used by playeranim
echo"playeranim.model_version = MTG_4_Jun_2017" >> "$WRITEABLE_MINETEST_CONF"# used by playeranim
# echo "player_model_version = default_character_v2" >> "$MYGAME_MINETEST_CONF" # formerly used by playeranim
echo"playeranim.model_version = MTG_4_Jun_2017" >> "$MYGAME_MINETEST_CONF"# used by playeranim
echo"using stable (minetest 0.4) branch of mods..."
echo"ERROR: could not find $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
echo" press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo" 3..."
sleep 1
echo" 2..."
sleep 1
echo" 1..."
sleep 1
exit1
customDie "ERROR: could not find $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
fi
if[ -d "$MTMOD_DEST_PATH"];then
echo"ERROR: could not remove $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
echo" press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo" 3..."
sleep 1
echo" 2..."
sleep 1
echo" 1..."
sleep 1
exit1
customDie "ERROR: could not remove $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
fi
#defaults are:
@ -410,7 +389,7 @@ if [ "$spawners_enable" = "true" ]; then
echo"SPAWN_PYRAMIDS = true" > settings.txt
echo"SPAWNERS_GENERATE = true" >> settings.txt
echo"CHESTS_GENERATE = false" >> settings.txt
sudo mv settings.txt "$MTMOD_DEST_PATH/"# formerly $MT_MYGAME_MODS_PATH/spawners/, now is spawners/spawners_env/
mv settings.txt "$MTMOD_DEST_PATH/"# formerly $MT_MYGAME_MODS_PATH/spawners/, now is spawners/spawners_env/
echo"NOTE: in spawners, only SPAWNERS_GENERATE or CHESTS_GENERATE, not both (chests seem to override) spawn in world for now. See thread for updated info: https://forum.minetest.net/viewtopic.php?f=11&t=13857&start=25"
echo"see also poikilos's game-install-enliven-testing-SPAWNERS_BOTH_DEBUG.txt"
# description="Installing Napiophelios's lapis fork since has blocks, but minetest-mods has a version as well, with dye (not used): https://forum.minetest.net/viewtopic.php?f=9&t=11287"
echo"PATCHED $MTMOD_DEST_PATH/init.lua to enable columns"
else
echo"WARNING: not enabling columns in $MTMOD_DEST_PATH/init.lua since already patched as indicated by the presence of '$MTMOD_DEST_PATH/columns_enabled' flag file."
fi
else
echo"FAILED to patch lapis since no $MTMOD_DEST_PATH/init.lua"
echo" press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo" 3..."
sleep 1
echo" 2..."
sleep 1
echo" 1..."
sleep 1
exit1
fi
#echo "patching lapis (Napiophelios's fork) to enable columns..."
# echo "PATCHED $MTMOD_DEST_PATH/init.lua to enable columns"
# else
# echo "WARNING: not enabling columns in $MTMOD_DEST_PATH/init.lua since already patched as indicated by the presence of '$MTMOD_DEST_PATH/columns_enabled' flag file."
# fi
#else
# customDie "FAILED to patch lapis since no $MTMOD_DEST_PATH/init.lua"
#fi
echo"not installing helicopter--crashes 0.4.14-git, but was updated on 2017-06-08 and was not tested since then"
# birthstones: poikilos fork of a rather non-maintained mod--forum link is at https://forum.minetest.net/viewtopic.php?id=3663 (original mod was at https://github.com/Doc22/birthstones-mod.git)
# kaeza's signs_lib (forked from PilzAdam's and TheXYZ's code) was moved here from: https://github.com/kaeza/minetest-signs_lib-extrafonts/archive/master.zip
echo"NOTICE: For B3DExport from Blender you must manually install $HOME/Downloads/B3DExport/B3DExport.py using Blender's File Menu, User Preferences, Add-ons, 'Install Add-on from File...', press OK, then check the 'Import-Export B3D' box in the Add-ons list, then Save User Settings"
@ -1139,3 +1082,22 @@ echo
echo"* there is no armor bar at this time since hudbars is not being used (not used due to issue where overlaps the new 5.0.0-dev hud)"
echo"* You may consider changing $MT_MYGAME_MODS_PATH/technic/technic/config.lua so that flashlight is enabled (however, this will probably cause lag)"
echo
echo"If any uncommented commands appear below, consider running them if repairs are needed:"