diff --git a/build.gradle b/build.gradle index bbdca7e..790e093 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar buildscript { repositories { - jcenter() + gradlePluginPortal() maven {url = "http://files.minecraftforge.net/maven"} } dependencies { @@ -12,7 +12,7 @@ buildscript { apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' -version = "2.5" +version = "2.5.1" group = "ofdev" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "aa_do_not_rename_OptiFineDevTweaker" @@ -22,11 +22,11 @@ compileJava { } repositories { + maven { url = 'https://files.minecraftforge.net/maven' } + mavenCentral() maven { url "https://libraries.minecraft.net/" } - maven { url = 'https://files.minecraftforge.net/maven' } - mavenCentral() } configurations { @@ -37,7 +37,7 @@ dependencies { shadow("org.ow2.asm:asm-debug-all:5.2") compileOnly 'cpw.mods:modlauncher:4.0.+' compileOnly('net.minecraft:launchwrapper:1.12') { - transitive = false + transitive = true } } @@ -78,6 +78,7 @@ task shadowJarAll(type: ShadowJar) { dependsOn(shadowJarLW) from(sourceSets.main.output) { include('ofdev/modlauncher/**') + include('META-INF/**') } from(shadowJarLW.archivePath.absolutePath) { include('*') diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/ofdev/launchwrapper/OptifineDevRemapper.java b/src/main/java/ofdev/launchwrapper/OptifineDevRemapper.java index 5b9a428..bafc284 100644 --- a/src/main/java/ofdev/launchwrapper/OptifineDevRemapper.java +++ b/src/main/java/ofdev/launchwrapper/OptifineDevRemapper.java @@ -22,8 +22,6 @@ import java.util.Map; import java.util.Set; -import javax.annotation.Nullable; - // this class is a modified version of FMLDeobfuscatingRemapper public class OptifineDevRemapper extends Remapper { @@ -132,7 +130,6 @@ private void parseField(String[] parts) { private Set negativeCacheMethods = new HashSet<>(); private Set negativeCacheFields = new HashSet<>(); - @Nullable private String getFieldType(String owner, String name) { if (fieldDescriptions.containsKey(owner)) { return fieldDescriptions.get(owner).get(name); @@ -204,11 +201,11 @@ private void storeMemberFieldMapping(String owner, String name, String desc, Str } @Override - public String mapFieldName(String owner, String name, @Nullable String desc) { + public String mapFieldName(String owner, String name, String desc) { return mapFieldName(owner, name, desc, false); } - String mapFieldName(String owner, String name, @Nullable String desc, boolean raw) { + String mapFieldName(String owner, String name, String desc, boolean raw) { if (classNameMap == null || classNameMap.isEmpty()) { return name; } @@ -259,7 +256,6 @@ public String mapMethodName(String owner, String name, String desc) { } @Override - @Nullable public String mapSignature(String signature, boolean typeSignature) { // JDT decorates some lambdas with this and SignatureReader chokes on it if (signature != null && signature.contains("!*")) { @@ -323,7 +319,7 @@ private void findAndMergeSuperMaps(String name) { } } - public void mergeSuperMaps(String name, @Nullable String superName, String[] interfaces) { + public void mergeSuperMaps(String name, String superName, String[] interfaces) { // System.out.printf("Computing super maps for %s: %s %s\n", name, superName, Arrays.asList(interfaces)); if (classNameMap == null || classNameMap.isEmpty()) { return; @@ -376,7 +372,6 @@ public String notchFromMcpOrDefault(String className) { return classNameMapInverse.getOrDefault(className, className); } - @Nullable public String getStaticFieldType(String oldType, String oldName, String newType, String newName) { String fType = getFieldType(newType, newName); if (oldType.equals(newType)) { diff --git a/src/main/java/ofdev/modlauncher/OFDevRetransformer.java b/src/main/java/ofdev/modlauncher/OFDevRetransformer.java index 9286fb2..681f26c 100644 --- a/src/main/java/ofdev/modlauncher/OFDevRetransformer.java +++ b/src/main/java/ofdev/modlauncher/OFDevRetransformer.java @@ -29,8 +29,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; - public class OFDevRetransformer implements ITransformer { private static final Logger LOGGER = LogManager.getLogger(); @@ -85,7 +83,7 @@ private static Collection findOptiFineClasses(IEnvironment env return newTargets; } - @Nonnull @Override public ClassNode transform(ClassNode input, ITransformerVotingContext context) { + @Override public ClassNode transform(ClassNode input, ITransformerVotingContext context) { ClassNode output = new ClassNode(); ClassRemapper classRemapper = new ClassRemapper(output, remapper); input.accept(classRemapper); @@ -99,11 +97,11 @@ private static Collection findOptiFineClasses(IEnvironment env return output; } - @Nonnull @Override public TransformerVoteResult castVote(ITransformerVotingContext context) { + @Override public TransformerVoteResult castVote(ITransformerVotingContext context) { return TransformerVoteResult.YES; } - @Nonnull @Override public Set targets() { + @Override public Set targets() { return targets; } diff --git a/src/main/java/ofdev/modlauncher/OFDevTransformationService.java b/src/main/java/ofdev/modlauncher/OFDevTransformationService.java index a0f3c10..6b717e5 100644 --- a/src/main/java/ofdev/modlauncher/OFDevTransformationService.java +++ b/src/main/java/ofdev/modlauncher/OFDevTransformationService.java @@ -48,8 +48,6 @@ import java.util.function.BiFunction; import java.util.zip.ZipFile; -import javax.annotation.Nonnull; - public class OFDevTransformationService implements ITransformationService { private static final Logger LOGGER = LogManager.getLogger(); @@ -76,7 +74,7 @@ private static Path findObfMcJar(IEnvironment env) { private static IEnvironment env; private static BiConsumer fixMemberAccess; - @Nonnull @Override public String name() { + @Override public String name() { return "OptiFineDevTransformationService"; } @@ -208,7 +206,7 @@ public static ClassNode wrapOptiFineTransform(ClassNode transformed, ClassNode o return output; } - @Nonnull @Override public List transformers() { + @Override public List transformers() { return Collections.singletonList(new OFDevRetransformer(env)); }