ForgePatch/forge/setup.sh

71 lines
1.6 KiB
Bash
Raw Normal View History

2011-08-05 00:32:56 +00:00
#!/bin/bash
echo "MinecraftForge Linux Setup Program"
echo
pushd .. > /dev/null
if [ -d src ] ; then
echo "!!! WARNING !!!"
echo
echo "This setup will erase your src directory. Make sure to back up"
echo "any changes before continuing."
echo
read -p "Continue (y/n)? " var
if [ "$var" != "y" ]; then exit ; fi
fi
if [ ! -f ../runtime/bin/fernflower.jar]
then
python download_fernflower.py
fi
if [ ! -f ../runtime/bin/fernflower.jar]
then
echo "Failed to download fernflower, install it manually and re-run setup."
exit 1
fi
2011-08-05 00:32:56 +00:00
rm -rf src src_work src_forge
if [ ! -d src_base ] ; then
./decompile.sh
pushd src > /dev/null
2011-09-11 04:46:16 +00:00
find . -name *.java -exec sed -i 's/\r//g' \{\} \;
cp ../forge/MLProp.java minecraft/net/minecraft/src/MLProp.java
cp ../forge/MLProp.java minecraft_server/net/minecraft/src/MLProp.java
patch -p2 -i ../forge/modLoaderMP.patch
2011-08-05 00:32:56 +00:00
popd > /dev/null
mv src src_base
fi
cp -a src_base src_work
pushd src_work > /dev/null
for i in `find ../forge/patches/ -type f -name \*.patch`
do
patch -p2 -i $i
done
2011-08-05 00:32:56 +00:00
popd > /dev/null
cp -a src_work src_forge
cp -a forge/forge_client/src/net/* src_forge/minecraft/net/
cp -a forge/forge_common/net/* src_forge/minecraft/net/
cp -a forge/forge_common/net/* src_forge/minecraft_server/net/
2012-02-21 08:53:33 +00:00
cp -a forge/forge_server/src/net/* src_forge/minecraft_server/net/
pushd forge > /dev/null
./inject_version.sh $OLDPWD/src_forge/minecraft/net/minecraft/src/forge/ForgeHooks.java
./inject_version.sh $OLDPWD/src_forge/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
popd > /dev/null
2011-08-05 00:32:56 +00:00
cp -a src_forge src
./updatemd5.sh