Skip to content

Commit

Permalink
Fix NestFixer Spec hashcode
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Apr 4, 2024
1 parent 16383cf commit 1b60876
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/babric/processor/NestFixingJarProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,31 @@
import net.fabricmc.loom.api.processor.MinecraftJarProcessor;
import net.fabricmc.loom.api.processor.ProcessorContext;
import net.fabricmc.loom.api.processor.SpecContext;
import net.fabricmc.loom.util.fmj.FabricModJson;
import net.fabricmc.stitch.commands.CommandFixNesting;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;

public class NestFixingJarProcessor implements MinecraftJarProcessor<NestFixingJarProcessor.Spec> {

@Override
public @Nullable NestFixingJarProcessor.Spec buildSpec(SpecContext specContext) {
return new Spec();
return new Spec(specContext.allMods());
}

@Override
public void processJar(Path path, Spec spec, ProcessorContext processorContext) throws IOException {
File file = path.getParent().resolve(".fixedNest").toFile();

if (!file.exists()) {
CommandFixNesting.run(path.toFile());
file.createNewFile();
}
CommandFixNesting.run(path.toFile());
}

@Override
public String getName() {
return "babric:fix-nesting";
}

public static class Spec implements MinecraftJarProcessor.Spec {}
public record Spec(List<FabricModJson> modJsons) implements MinecraftJarProcessor.Spec {}
}

0 comments on commit 1b60876

Please sign in to comment.