Last active
February 12, 2025 16:56
-
-
Save jasonk/9061794 to your computer and use it in GitHub Desktop.
Setup script for Minecraft Bukkit, ScriptCraft, and MQTT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd "$(dirname "$0")" | |
# CraftBukkit download URL | |
CBURL="http://repo.bukkit.org/content/groups/public/org/bukkit/craftbukkit/1.7.2-R0.3/craftbukkit-1.7.2-R0.3.jar" | |
# ScriptCraft download URL | |
SCURL="http://scriptcraftjs.org/download/2014-02/v2.0.4/scriptcraft.jar" | |
# Install CraftBukkit | |
if [ ! -f craftbukkit.jar ]; then | |
curl -L -o craftbukkit.jar "$CBURL" | |
fi | |
# Make the plugins directory if it's missing | |
if [ ! -d plugins ]; then mkdir plugins; fi | |
# Install ScriptCraft | |
if [ ! -f plugins/scriptcraft.jar ]; then | |
curl -L -o plugins/scriptcraft.jar "$SCURL" | |
fi | |
# Install sc-mqtt.jar | |
if [ ! -f sc-mqtt.jar ]; then | |
curl -LO http://scriptcraftjs.org/download/extras/mqtt/sc-mqtt.jar | |
fi | |
# Install mosquitto | |
if [ ! -f mosquitto.conf ]; then | |
brew install mosquitto | |
touch mosquitto.conf | |
fi | |
# Make a handy link to the scriptcraft plugins directory | |
if [ ! -e sc-plugins ]; then | |
ln -s plugins/scriptcraft/plugins sc-plugins | |
fi | |
# Create a start script | |
if [ ! -f "start.sh" ]; then | |
cat <<'END' > start.sh | |
#!/bin/bash | |
cd "$(dirname "$0")" | |
mosquitto -c ./mosquitto.conf & | |
MOSQUITTO_PID=$! | |
java -Xmx1024M -cp sc-mqtt.jar:craftbukkit.jar org.bukkit.craftbukkit.Main | |
kill $MOSQUITTO_PID | |
END | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment