rename more things: nonsense->frog

This commit is contained in:
moehreag 2024-06-03 13:31:00 +02:00
parent 3e21b4d8d5
commit 333d5889b7
7 changed files with 13 additions and 13 deletions

View file

@ -36,8 +36,8 @@ class PhytotelmaPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project) {
println("> Applying FrogMC Gradle Plugin") println("> Applying FrogMC Gradle Plugin")
nonsenseCacheDir = project.gradle.gradleUserHomeDir.resolve("caches/phytotelma/").toPath() globalCacheDir = project.gradle.gradleUserHomeDir.resolve("caches/phytotelma/").toPath()
nonsenseCacheDir.createDirectories() globalCacheDir.createDirectories()
project.plugins.let { project.plugins.let {
it.apply("java-library") it.apply("java-library")
@ -183,7 +183,7 @@ class PhytotelmaPlugin : Plugin<Project> {
} }
companion object { companion object {
lateinit var nonsenseCacheDir: Path lateinit var globalCacheDir: Path
lateinit var minecraftVersion: String lateinit var minecraftVersion: String
lateinit var remappedGameJarPath: Path lateinit var remappedGameJarPath: Path
lateinit var parchmentVersion: String lateinit var parchmentVersion: String

View file

@ -17,7 +17,7 @@ object VersionChecker {
fetchVersionData(version) fetchVersionData(version)
val clientData = fetchClientDownload(version) val clientData = fetchClientDownload(version)
// download client data // download client data
val downloadDirectory = PhytotelmaPlugin.nonsenseCacheDir.resolve("net/minecraft/client/$version/") val downloadDirectory = PhytotelmaPlugin.globalCacheDir.resolve("net/minecraft/client/$version/")
val downloadFile = downloadDirectory.resolve("client-$version.jar") val downloadFile = downloadDirectory.resolve("client-$version.jar")
if (downloadFile.exists()) { if (downloadFile.exists()) {
println("Client already downloaded! Assuming it's valid. FIXME: Add checksum validation.") println("Client already downloaded! Assuming it's valid. FIXME: Add checksum validation.")

View file

@ -39,7 +39,7 @@ object CachingHttpClient {
} }
private fun getCacheFile(uri: URI): Path { private fun getCacheFile(uri: URI): Path {
val path = PhytotelmaPlugin.nonsenseCacheDir.resolve("httpCache") val path = PhytotelmaPlugin.globalCacheDir.resolve("httpCache")
.resolve(uri.host+uri.rawPath) // Use rawPath to ensure ASCII compat (since this will be a filesystem dir) .resolve(uri.host+uri.rawPath) // Use rawPath to ensure ASCII compat (since this will be a filesystem dir)
path.createParentDirectories() path.createParentDirectories()
return path return path

View file

@ -41,7 +41,7 @@ fun Project.minecraft(
val paramMappings = if (parchment.isNotEmpty()) kotlin.runCatching { val paramMappings = if (parchment.isNotEmpty()) kotlin.runCatching {
ParchmentProvider.getParchment( ParchmentProvider.getParchment(
version, parchment, version, parchment,
PhytotelmaPlugin.nonsenseCacheDir.resolve("org/parchmentmc/parchment/$version/$parchment") PhytotelmaPlugin.globalCacheDir.resolve("org/parchmentmc/parchment/$version/$parchment")
) )
}.getOrNull() else { }.getOrNull() else {
println("Parameter mappings will not be present as no parchment version was found. It may be possible to declare it manually.") println("Parameter mappings will not be present as no parchment version was found. It may be possible to declare it manually.")

View file

@ -16,7 +16,7 @@ object AssetDownloader {
fun download() { fun download() {
val version = PhytotelmaPlugin.minecraftVersion val version = PhytotelmaPlugin.minecraftVersion
val path = PhytotelmaPlugin.nonsenseCacheDir.resolve("assets") val path = PhytotelmaPlugin.globalCacheDir.resolve("assets")
val id = VersionChecker.downloadAssetIndex(version, path.resolve("indexes")) val id = VersionChecker.downloadAssetIndex(version, path.resolve("indexes"))
val index = Gson().fromJson( val index = Gson().fromJson(

View file

@ -27,7 +27,7 @@ object RunConfigGenerator {
} }
} }
val assetPath = PhytotelmaPlugin.nonsenseCacheDir.resolve(ASSET_DIR).absolute() val assetPath = PhytotelmaPlugin.globalCacheDir.resolve(ASSET_DIR).absolute()
val assetIndexPath = assetPath.resolve("indexes") val assetIndexPath = assetPath.resolve("indexes")
if (assetIndexPath.notExists()) { if (assetIndexPath.notExists()) {
assetIndexPath.createDirectories() assetIndexPath.createDirectories()
@ -42,7 +42,7 @@ object RunConfigGenerator {
adapter.generate( adapter.generate(
project, project,
"Minecraft ${env.pascalName}", "Minecraft ${env.pascalName}",
"dev.frogmc.frogloader.impl.launch.${env.id}.Nonsense${env.pascalName}", "dev.frogmc.frogloader.impl.launch.${env.id}.Frog${env.pascalName}",
mutableListOf( mutableListOf(
"-Xmx${project.properties.getOrDefault("frogmc.gameHeap", "2048M")}", "-Xmx${project.properties.getOrDefault("frogmc.gameHeap", "2048M")}",
"-Dfrogmc.development=true", "-Dfrogmc.development=true",
@ -56,7 +56,7 @@ object RunConfigGenerator {
}.toTypedArray(), if (env == Env.CLIENT) { }.toTypedArray(), if (env == Env.CLIENT) {
arrayOf( arrayOf(
"--assetsDir", assetPath.toString(), "--assetsDir", assetPath.toString(),
"--version", "Nonsense", "--version", "FrogMC",
"--assetIndex", indexId, "--assetIndex", indexId,
"--accessToken", "0" "--accessToken", "0"
) )

View file

@ -22,7 +22,7 @@ abstract class RunGameTask @Inject constructor(env: Env) : JavaExec() {
init { init {
group = "frogmc" group = "frogmc"
val assetPath = PhytotelmaPlugin.nonsenseCacheDir.resolve("assets").absolute() val assetPath = PhytotelmaPlugin.globalCacheDir.resolve("assets").absolute()
val assetIndexPath = assetPath.resolve("indexes") val assetIndexPath = assetPath.resolve("indexes")
if (assetIndexPath.notExists()) { if (assetIndexPath.notExists()) {
assetIndexPath.createDirectories() assetIndexPath.createDirectories()
@ -40,7 +40,7 @@ abstract class RunGameTask @Inject constructor(env: Env) : JavaExec() {
if (env == Env.CLIENT) { if (env == Env.CLIENT) {
listOf( listOf(
"--assetsDir", assetPath.toString(), "--assetsDir", assetPath.toString(),
"--version", "Nonsense", "--version", "FrogMC",
"--assetIndex", indexId, "--assetIndex", indexId,
"--accessToken", "0" "--accessToken", "0"
) )
@ -65,7 +65,7 @@ abstract class RunGameTask @Inject constructor(env: Env) : JavaExec() {
jvmArguments.add("-Dfrogmc.log.disableAnsi=false") jvmArguments.add("-Dfrogmc.log.disableAnsi=false")
} }
mainClass.set("dev.frogmc.frogloader.impl.launch.${env.id}.Nonsense${env.pascalName}") mainClass.set("dev.frogmc.frogloader.impl.launch.${env.id}.Frog${env.pascalName}")
} }
private fun writeArgFile(): String { private fun writeArgFile(): String {