Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
I have no idea why everything suddenly broke. Why did it even work?
  • Loading branch information
Barteks2x committed Apr 7, 2021
1 parent 772902b commit 2104355
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"

Expand All @@ -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 {
Expand All @@ -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
}
}

Expand Down Expand Up @@ -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('*')
Expand Down
Empty file added settings.gradle
Empty file.
11 changes: 3 additions & 8 deletions src/main/java/ofdev/launchwrapper/OptifineDevRemapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -132,7 +130,6 @@ private void parseField(String[] parts) {
private Set<String> negativeCacheMethods = new HashSet<>();
private Set<String> negativeCacheFields = new HashSet<>();

@Nullable
private String getFieldType(String owner, String name) {
if (fieldDescriptions.containsKey(owner)) {
return fieldDescriptions.get(owner).get(name);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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("!*")) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/ofdev/modlauncher/OFDevRetransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.annotation.Nonnull;

public class OFDevRetransformer implements ITransformer<ClassNode> {

private static final Logger LOGGER = LogManager.getLogger();
Expand Down Expand Up @@ -85,7 +83,7 @@ private static Collection<? extends Target> 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);
Expand All @@ -99,11 +97,11 @@ private static Collection<? extends Target> 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<Target> targets() {
@Override public Set<Target> targets() {
return targets;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -76,7 +74,7 @@ private static Path findObfMcJar(IEnvironment env) {
private static IEnvironment env;
private static BiConsumer<ClassNode, ClassNode> fixMemberAccess;

@Nonnull @Override public String name() {
@Override public String name() {
return "OptiFineDevTransformationService";
}

Expand Down Expand Up @@ -208,7 +206,7 @@ public static ClassNode wrapOptiFineTransform(ClassNode transformed, ClassNode o
return output;
}

@Nonnull @Override public List<ITransformer> transformers() {
@Override public List<ITransformer> transformers() {
return Collections.singletonList(new OFDevRetransformer(env));
}

Expand Down

0 comments on commit 2104355

Please sign in to comment.