Skip to content

Commit

Permalink
allow adding overrides per version
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkyAI committed Mar 21, 2021
1 parent 8acf4a5 commit d0fd86d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion voodoo/src/main/kotlin/voodoo/cli/CompileCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CompileCommand() : CliktCommand(
val modpack = versionPack.flatten(
rootDir = rootDir,
id = id,
overrides = config.overrides,
configOverrides = config.overrides,
metaPack = metaPack
)
// logger.debug { "modpack: $modpack" }
Expand Down
2 changes: 1 addition & 1 deletion voodoo/src/main/kotlin/voodoo/pack/FileEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ sealed class FileEntry {
curse_useOriginalUrl = override.curse_useOriginalUrl ?: curse_useOriginalUrl,
curse_skipFingerprintCheck = override.curse_skipFingerprintCheck ?: curse_skipFingerprintCheck,
).run {
assignCommonValues(applyCommonOverride(override))
applyCommonOverride(override)
}
is EntryOverride.Common -> run {
applyCommonOverride(override) as Curse
Expand Down
5 changes: 3 additions & 2 deletions voodoo/src/main/kotlin/voodoo/pack/VersionPack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ data class VersionPack(
val mcVersion: String,
val modloader: Modloader,
val packageConfiguration: VersionPackageConfig = VersionPackageConfig(),
val overrides: Map<String, EntryOverride> = mapOf(),
@JsonSchema.Definition("FileEntryList")
val mods: Map<String, List<FileEntry>>,
) {
Expand Down Expand Up @@ -148,7 +149,7 @@ data class VersionPack(
}
}

fun flatten(rootDir: File, id: String, metaPack: MetaPack, overrides: Map<String, EntryOverride>): FlatModPack {
fun flatten(rootDir: File, id: String, metaPack: MetaPack, configOverrides: Map<String, EntryOverride>): FlatModPack {
return FlatModPack(
rootFolder = rootDir,
id = id,
Expand Down Expand Up @@ -183,7 +184,7 @@ data class VersionPack(
entry.postParse(overrideKey)
}
}.map { intitalEntry ->
intitalEntry.toEntry(overrides)
intitalEntry.toEntry(configOverrides + overrides)
}.toMutableSet()
).apply {

Expand Down

0 comments on commit d0fd86d

Please sign in to comment.