Skip to content

Commit

Permalink
BREAKING CHANGE: rename properties in ModSyncInfo for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Jul 6, 2024
1 parent a80a8e3 commit ad684dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/src/main/kotlin/syncInfo/models/mod/Mod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ data class Mod(
* */
val verifyFileIntegrity: Boolean? = null,
/**
* Will override [ModSyncInfo.syncAllOptionalForCurrentEnv] for a specific mod
* Will override [ModSyncInfo.syncOptionalModsForCurrentEnv] for a specific mod
* */
val syncOptionalForCurrentEnv: Boolean? = null,
) {
Expand Down
10 changes: 5 additions & 5 deletions common/src/main/kotlin/syncInfo/models/mod/ModSyncInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ data class ModSyncInfo(
* You will get an error from the mod loader.
*
* */
val syncOnlyForCurrentEnv: Boolean = true,
val syncOnlyModsForCurrentEnv: Boolean = true,
/**
* Indicates whether optional mods for the current [Environment] should be synced.
*
* Some mods might be optional to install on either server or client side or both.
*
* This setting only takes effect if [syncOnlyForCurrentEnv] is `true`.
* If [syncOnlyForCurrentEnv] is `false`, this property has no impact.
* This setting only takes effect if [syncOnlyModsForCurrentEnv] is `true`.
* If [syncOnlyModsForCurrentEnv] is `false`, this property has no impact.
*
* if [syncAllOptionalForCurrentEnv] is `false`, then will only sync the
* if [syncOptionalModsForCurrentEnv] is `false`, then will only sync the
* required mods for the current system [Environment].
*
* @see Mod.syncOptionalForCurrentEnv
* */
val syncAllOptionalForCurrentEnv: Boolean = true,
val syncOptionalModsForCurrentEnv: Boolean = true,
/**
* Determines whether the script allows the player to use mods other than those synchronized by the script.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun Mod.getDisplayName(): String = name ?: getFileNameFromUrlOrError(downloadUrl

private fun Mod.shouldSyncOptionalModForCurrentEnvironment() =
syncOptionalForCurrentEnv
?: SyncInfo.instance.modSyncInfo.syncAllOptionalForCurrentEnv
?: SyncInfo.instance.modSyncInfo.syncOptionalModsForCurrentEnv

/**
* If this mod should be downloaded on the current [Environment].
Expand Down
2 changes: 1 addition & 1 deletion sync-script/src/main/kotlin/syncService/ModsSyncService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ModsSyncService :
}

private fun getCurrentEnvironmentModsOrAll(mods: List<Mod>): List<Mod> {
if (!modSyncInfo.syncOnlyForCurrentEnv) {
if (!modSyncInfo.syncOnlyModsForCurrentEnv) {
return mods
}
val currentEnvironmentMods =
Expand Down

0 comments on commit ad684dc

Please sign in to comment.