From 1d1e1b71835fb8b405c4ce033d2c57ef18b3afb1 Mon Sep 17 00:00:00 2001 From: Matthew Periut Date: Tue, 15 Oct 2024 16:12:57 -0400 Subject: [PATCH] Macos theming (#7) * Use system theme when on macOS * Remove sout --- src/main/java/babric/BabricLoomPlugin.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/babric/BabricLoomPlugin.java b/src/main/java/babric/BabricLoomPlugin.java index 51b8fa1..14c7021 100644 --- a/src/main/java/babric/BabricLoomPlugin.java +++ b/src/main/java/babric/BabricLoomPlugin.java @@ -11,6 +11,7 @@ import org.gradle.api.Project; import org.gradle.api.plugins.PluginAware; import org.gradle.api.provider.ListProperty; +import org.gradle.internal.os.OperatingSystem; import java.util.Map; import java.util.Objects; @@ -46,5 +47,15 @@ private void applyProject(Project project) { }); extension.addMinecraftJarProcessor(NestFixingJarProcessor.class); + + project.afterEvaluate(p -> { + if (OperatingSystem.current().isMacOsX()) { + extension.getRunConfigs().configureEach(runConfig -> { + if (runConfig.getName().equals("client")) { + runConfig.getVmArgs().add("-Dapple.awt.application.appearance=system"); + } + }); + } + }); } }