From 4bc2f86ea825dca36d8684b7bb56ecd72b7295e5 Mon Sep 17 00:00:00 2001 From: Eloraam Date: Fri, 5 Aug 2011 00:32:56 +0000 Subject: [PATCH] New install script for Linux users. --- forge/build.sh | 14 +++++----- forge/mlprop.patch | 70 ++++++++++++++++++++++++++++++++++++++++++++++ forge/setup.sh | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 forge/mlprop.patch create mode 100755 forge/setup.sh diff --git a/forge/build.sh b/forge/build.sh index c527cc9fc..8f0238a3d 100755 --- a/forge/build.sh +++ b/forge/build.sh @@ -2,15 +2,15 @@ pushd .. -rm -rf src -cp -a src_work src -rm -rf bin +rm -rf src bin -popd +cp -a src_work src_forge -cp -a forge_client/src/net/* ../src/minecraft/net/ -cp -a forge_common/net/* ../src/minecraft/net/ -cp -a forge_common/net/* ../src/minecraft_server/net/ +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/ + +cp -a src_forge src pushd .. diff --git a/forge/mlprop.patch b/forge/mlprop.patch new file mode 100644 index 000000000..f6f956979 --- /dev/null +++ b/forge/mlprop.patch @@ -0,0 +1,70 @@ +diff -ru src/minecraft/net/minecraft/src/MLProp.java src_fix/minecraft/net/minecraft/src/MLProp.java +--- src/minecraft/net/minecraft/src/MLProp.java 2011-08-04 20:10:17.000000000 -0400 ++++ src_fix/minecraft/net/minecraft/src/MLProp.java 2011-08-04 20:12:55.000000000 -0400 +@@ -1,20 +1,11 @@ +-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. +-// Jad home page: http://www.kpdus.com/jad.html +-// Decompiler options: packimports(3) braces deadcode +- +-package net.minecraft.src; +- +-import java.lang.annotation.Annotation; +- +-public interface MLProp +- extends Annotation +-{ +- +- public abstract String name(); +- +- public abstract String info(); +- +- public abstract double min(); +- +- public abstract double max(); +-} ++package net.minecraft.src; ++import java.lang.annotation.*; ++ ++@Retention(RetentionPolicy.RUNTIME) ++@Target(ElementType.FIELD) ++public @interface MLProp { ++ String name() default ""; ++ String info() default ""; ++ double min() default Double.NEGATIVE_INFINITY; ++ double max() default Double.POSITIVE_INFINITY; ++} +diff -ru src/minecraft_server/net/minecraft/src/MLProp.java src_fix/minecraft_server/net/minecraft/src/MLProp.java +--- src/minecraft_server/net/minecraft/src/MLProp.java 2011-08-04 20:10:17.000000000 -0400 ++++ src_fix/minecraft_server/net/minecraft/src/MLProp.java 2011-08-04 20:13:00.000000000 -0400 +@@ -1,20 +1,11 @@ +-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. +-// Jad home page: http://www.kpdus.com/jad.html +-// Decompiler options: packimports(3) braces deadcode +- +-package net.minecraft.src; +- +-import java.lang.annotation.Annotation; +- +-public interface MLProp +- extends Annotation +-{ +- +- public abstract String name(); +- +- public abstract String info(); +- +- public abstract double min(); +- +- public abstract double max(); +-} ++package net.minecraft.src; ++import java.lang.annotation.*; ++ ++@Retention(RetentionPolicy.RUNTIME) ++@Target(ElementType.FIELD) ++public @interface MLProp { ++ String name() default ""; ++ String info() default ""; ++ double min() default Double.NEGATIVE_INFINITY; ++ double max() default Double.POSITIVE_INFINITY; ++} diff --git a/forge/setup.sh b/forge/setup.sh new file mode 100755 index 000000000..81475d6ed --- /dev/null +++ b/forge/setup.sh @@ -0,0 +1,49 @@ +#!/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 + +rm -rf src src_work src_forge + +if [ ! -d src_base ] ; then + ./decompile.sh + pushd src > /dev/null + + find -name *.java -exec sed -i 's/\r//g' \{\} \; + patch -p2 -i ../forge/modLoaderMP.patch + patch -p1 -i ../forge/mlprop.patch + + popd > /dev/null + + mv src src_base +fi + +cp -a src_base src_work +pushd src_work > /dev/null + patch -p2 -i ../forge/minecraft.patch +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/ + +cp -a src_forge src + +./updatemd5.sh +