Skip to content

Commit 3aef4b1

Browse files
committed
Fixed adding boolean false providers to args
1 parent 03454ec commit 3aef4b1

File tree

1 file changed

+5
-3
lines changed
  • gradleutils-shared/src/main/java/net/minecraftforge/gradleutils/shared

1 file changed

+5
-3
lines changed

gradleutils-shared/src/main/java/net/minecraftforge/gradleutils/shared/ToolExecBase.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,12 @@ protected final void args(String arg, @UnknownNullability Provider<?> provider)
285285
var value = provider.map(it -> it instanceof FileSystemLocation ? ((FileSystemLocation) it).getAsFile() : it).getOrNull();
286286
if (value == null) return;
287287

288-
if (value instanceof Boolean && ((boolean) value))
289-
this.args(arg);
290-
else
288+
if (value instanceof Boolean booleanValue) {
289+
if (booleanValue)
290+
this.args(arg);
291+
} else {
291292
this.args(arg, String.valueOf(value));
293+
}
292294
}
293295

294296
/// Adds the given map of arguments.

0 commit comments

Comments
 (0)