commit 9c0786763c01a3e09230cb28c2669b0147e5ce97 Author: Petr Mrázek Date: Fri Apr 8 01:20:45 2016 +0200 Initial commit diff --git a/OptiFineHack/.gitignore b/OptiFineHack/.gitignore new file mode 100644 index 0000000..9ffdfa5 --- /dev/null +++ b/OptiFineHack/.gitignore @@ -0,0 +1,5 @@ +.directory +out/ +*.kate-swp +*.log +*.jar diff --git a/OptiFineHack/OptiFineHackTweaker.java b/OptiFineHack/OptiFineHackTweaker.java new file mode 100644 index 0000000..6328457 --- /dev/null +++ b/OptiFineHack/OptiFineHackTweaker.java @@ -0,0 +1,39 @@ +package org.multimc.hacks; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.LaunchClassLoader; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +public class OptiFineHackTweaker implements ITweaker +{ + private List args; + + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + this.args = new ArrayList(args); + this.args.add("--gameDir"); + this.args.add(gameDir.getAbsolutePath()); + this.args.add("--assetsDir"); + this.args.add(assetsDir.getAbsolutePath()); + this.args.add("--version"); + this.args.add(profile); + } + + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + classLoader.registerTransformer("optifine.OptiFineClassTransformer"); + } + + public String getLaunchTarget() + { + return "net.minecraft.client.main.Main"; + } + + public String[] getLaunchArguments() + { + return args.toArray(new String[this.args.size()]); + } +} diff --git a/OptiFineHack/build.sh b/OptiFineHack/build.sh new file mode 100755 index 0000000..0d2ec0a --- /dev/null +++ b/OptiFineHack/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e +cd "$(dirname "$0")" + +rm -rf out +mkdir out +javac -source 1.5 -target 1.5 -cp "launchwrapper-1.12.jar" *.java -d out/ > build.log 2>&1 +cd out +jar cvf ../OptiFineHack-1.jar * >> build.log 2>&1 diff --git a/OptiFineHack/launchwrapper-1.12.jar b/OptiFineHack/launchwrapper-1.12.jar new file mode 100644 index 0000000..0823549 Binary files /dev/null and b/OptiFineHack/launchwrapper-1.12.jar differ