diff --git a/build.gradle b/build.gradle index 8f7ce6d..8f91bd8 100644 --- a/build.gradle +++ b/build.gradle @@ -230,16 +230,36 @@ afterEvaluate { } runClient { - args "--mods=../build/libs/$modId-${version}.jar", - usesMixins.toBoolean() ? "--tweakClass org.spongepowered.asm.launch.MixinTweaker" : "", - developmentEnvironmentUserName.isEmpty() == false ? "--username": "", - developmentEnvironmentUserName.isEmpty() == false ? developmentEnvironmentUserName : "" + def arguments = [] + + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + if(developmentEnvironmentUserName) { + arguments += [ + "--username", + developmentEnvironmentUserName + ] + } + + args(arguments) } runServer { - args "--mods=../build/libs/$modId-${version}.jar", - usesMixins.toBoolean() ? "--tweakClass org.spongepowered.asm.launch.MixinTweaker" : "" + def arguments = [] + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + args(arguments) } processResources diff --git a/gradle.properties b/gradle.properties index c4d7c82..a28acbd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,12 @@ modGroup = com.myname.mymodid minecraftVersion = 1.7.10 forgeVersion = 10.13.4.1614 +# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +developmentEnvironmentUserName = "Developer" + # Define a source file of your project with: # public static final String VERSION = "GRADLETOKEN_VERSION"; # The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's @@ -45,9 +51,3 @@ containsMixinsAndOrCoreModOnly = false # If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. usesShadowedDependencies = false - -# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you -# restart Minecraft in development. Choose this dependent on your mod: -# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name -# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty -developmentEnvironmentUserName = "Developer"