2020-09-25 23:37:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-12-08 21:32:12 +00:00
|
|
|
# All Feature Flags
|
2020-12-08 23:20:25 +00:00
|
|
|
export AVAILABLE_FEATURES="$(echo \
|
|
|
|
"TRUE 'Touch GUI'" \
|
|
|
|
"TRUE 'Fix Bow & Arrow'" \
|
|
|
|
"TRUE 'Fix Attacking'" \
|
|
|
|
"TRUE 'Mob Spawning'" \
|
|
|
|
"TRUE 'Fancy Graphics'" \
|
|
|
|
"TRUE 'Disable Autojump By Default'" \
|
|
|
|
"TRUE 'Fix Sign Placement'" \
|
|
|
|
"TRUE 'Show Block Outlines'" \
|
|
|
|
"FALSE 'Expand Creative Inventory'" \
|
|
|
|
"FALSE 'Peaceful Mode'" \
|
|
|
|
"TRUE 'Animated Water'" \
|
|
|
|
"TRUE 'Remove Invalid Item Background'" \
|
|
|
|
"TRUE 'Disable gui_blocks Atlas'" \
|
|
|
|
"TRUE 'Smooth Lighting'" \
|
|
|
|
"FALSE '3D Anaglyph'")"
|
2020-12-08 21:32:12 +00:00
|
|
|
|
|
|
|
# Print Feature Flags Option
|
|
|
|
if [ "$1" = "--print-features" ]; then
|
|
|
|
echo "${AVAILABLE_FEATURES}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Ensure Features Are Selected
|
2020-12-08 23:20:25 +00:00
|
|
|
if [ -z "${MCPI_FEATURES+x}" ]; then
|
|
|
|
MCPI_FEATURES="$(sh -c "zenity --class 'Minecraft - Pi edition' --list --checklist --column 'Enabled' --column 'Feature' ${AVAILABLE_FEATURES}")"
|
|
|
|
fi
|
|
|
|
if [ -z "${MCPI_USERNAME+x}" ]; then
|
|
|
|
MCPI_USERNAME="$(zenity --class 'Minecraft - Pi edition' --entry --text 'Minecraft Username:' --entry-text 'StevePi')"
|
|
|
|
fi
|
2020-10-01 19:11:27 +00:00
|
|
|
export MCPI_FEATURES
|
2020-10-02 22:43:43 +00:00
|
|
|
export MCPI_USERNAME
|
2020-10-01 15:08:46 +00:00
|
|
|
|
2020-10-01 19:11:27 +00:00
|
|
|
# Ensure Groups Are Correct
|
2020-10-17 20:23:01 +00:00
|
|
|
if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then
|
|
|
|
pkexec usermod -aG docker "$(whoami)"
|
2020-10-01 18:33:52 +00:00
|
|
|
fi
|
|
|
|
|
2020-10-01 19:11:27 +00:00
|
|
|
# Allow X11 Connections From Root
|
2020-09-25 23:37:22 +00:00
|
|
|
xhost local:root
|
|
|
|
|
2020-10-16 19:39:04 +00:00
|
|
|
# Update Docker Container
|
|
|
|
export DOCKER_COMPOSE="docker-compose -f /usr/share/minecraft-pi/client/docker-compose.yml"
|
2020-10-15 02:51:30 +00:00
|
|
|
|
2020-10-16 19:39:04 +00:00
|
|
|
# Run
|
2020-10-17 20:23:01 +00:00
|
|
|
exec sg docker /usr/lib/minecraft-pi/run.sh
|