Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Minecraft Classic ! #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
group = 'net.minecraft'
archivesBaseName = 'launchwrapper'
version = '1.12'
sourceCompatibility = 1.6
sourceCompatibility = 1.8

dependencies {
compile 'net.sf.jopt-simple:jopt-simple:4.5'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package net.minecraft.launchwrapper;

import java.io.File;
import java.util.List;

import org.apache.logging.log4j.Level;

import net.minecraft.launchwrapper.injector.ClassicVanillaTweakInjector;

public class ClassicVanillaTweaker implements ITweaker {

private static final String TWEAK_INJECTOR_CLASS = ClassicVanillaTweakInjector.class.getName();
private List<String> arguments;

@Override
public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
arguments = args;
ClassicVanillaTweakInjector.minecraftPath = gameDir;
// Checking if we have enabled survival mode and announcing it.
ClassicVanillaTweakInjector.enableSurvivalPatch = args.contains("--survival");

if (ClassicVanillaTweakInjector.enableSurvivalPatch)
LogWrapper.log(Level.INFO, "Will enable surival patch.");
}

@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader) {
classLoader.registerTransformer(TWEAK_INJECTOR_CLASS);

}

@Override
public String getLaunchTarget() {
return TWEAK_INJECTOR_CLASS;
}

@Override
public String[] getLaunchArguments() {
return arguments.toArray(new String[arguments.size()]);
}

}
Loading