Skip to content

Commit

Permalink
Fix Attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Jun 2, 2024
1 parent 8039a4d commit b31b30e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/mmodding/gradle/MModdingGradle.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.mmodding.gradle.util.LoomProvider;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.plugins.JavaPluginExtension;
Expand All @@ -40,7 +41,8 @@ public MModdingGradle(final ObjectFactory objects, final Project project) {
}

public void configureFabricModJson(Action<FabricModJson> action) {
if (this.project.getTasks().findByPath("generation/generateFmj") != null) {
Task check = this.project.getTasks().findByPath("generation/generateFmj");
if (this.project.getTasks().findByPath("generateFmj") == null) {
var fmj = new FabricModJson();
fmj.fillDefaults(this.project);
action.execute(fmj);
Expand All @@ -55,7 +57,7 @@ public void configureFabricModJson(Action<FabricModJson> action) {
}
else {
// Behaving differently if the FabricModJson already exists
GenerateFabricModJson task = (GenerateFabricModJson) this.project.getTasks().getByPath("generation/generateFmj");
GenerateFabricModJson task = (GenerateFabricModJson) this.project.getTasks().getByName("generateFmj");
FabricModJson fmj = task.getModJson().get();
action.execute(fmj);
task.getModJson().set(fmj);
Expand Down

0 comments on commit b31b30e

Please sign in to comment.