Skip to content

Commit

Permalink
Suffix no longer exceeds length limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed May 15, 2024
1 parent 50e4c6b commit 4f73237
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,18 @@ unimined.minecraft {
javaVersion = JavaVersion.VERSION_21
}

val usernameSuffix = NetworkInterface.getNetworkInterfaces()
.nextElement()
.hardwareAddress
.toHexString()
.substring(0, 10)
for (name in listOf("host", "joiner")) {
val runName = "test${name.capitalized()}"
val user = name.uppercase()
val uniqueSystemId = NetworkInterface.getNetworkInterfaces().iterator().next().hardwareAddress.toHexString()
val provider = (minecraftData as MinecraftDownloader).provider
val baseConfig = provider.provideVanillaRunClientTask(runName, file("run/$runName"))
baseConfig.description = "Test $user"
baseConfig.args.replaceAll { if (it == "Dev") "$user$uniqueSystemId" else it }
baseConfig.args.replaceAll { if (it == "Dev") "$user$usernameSuffix" else it }
baseConfig.jvmArgs.add("-Dworld-host-testing.enabled=true")
baseConfig.jvmArgs.add("-Dworld-host-testing.user=$user")
baseConfig.jvmArgs.add("-Ddevauth.enabled=false")
Expand Down

0 comments on commit 4f73237

Please sign in to comment.