Skip to content

Commit

Permalink
Add Action overloads for NDOC properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed May 25, 2024
1 parent 292f770 commit 2c33e49
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.neoforged.moddevgradle.dsl;

import org.gradle.api.Action;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.NamedDomainObjectSet;
import org.gradle.api.Project;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
Expand Down Expand Up @@ -51,11 +51,19 @@ public NeoForgeExtension(Project project) {

public abstract ListProperty<String> getAccessTransformers();

public NamedDomainObjectSet<ModModel> getMods() {
public NamedDomainObjectContainer<ModModel> getMods() {
return mods;
}

public NamedDomainObjectSet<RunModel> getRuns() {
public void mods(Action<NamedDomainObjectContainer<ModModel>> action) {
action.execute(mods);
}

public NamedDomainObjectContainer<RunModel> getRuns() {
return runs;
}

public void runs(Action<NamedDomainObjectContainer<RunModel>> action) {
action.execute(runs);
}
}

0 comments on commit 2c33e49

Please sign in to comment.