Skip to content

Commit ad25a03

Browse files
committed
add alternative constructor for launchwrapper
1 parent 56fb40c commit ad25a03

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/main/kotlin/org/bundleproject/bundle/Bundle.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import kotlin.concurrent.withLock
3333
class Bundle(private val gameDir: File, private val version: Version?, modFolderName: String) {
3434
private val modsDir = File(gameDir, modFolderName)
3535

36+
constructor(gameDir: File, version: String?, modFolderName: String) : this(gameDir, version?.let(Version::of), modFolderName)
37+
3638
suspend fun start() {
3739
try {
3840
info("Starting Bundle...")
@@ -43,7 +45,11 @@ class Bundle(private val gameDir: File, private val version: Version?, modFolder
4345

4446
val outdated = getOutdatedMods()
4547

46-
if (outdated.isEmpty()) return
48+
// return if outdated is empty
49+
if (outdated.isEmpty()) {
50+
info("No outdated mods found.")
51+
return
52+
}
4753

4854
// val lock = ReentrantLock()
4955
// val condition = lock.newCondition()

src/main/kotlin/org/bundleproject/bundle/utils/Logger.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ const val PURPLE = "\u001b[0;35m"
1111
const val CYAN = "\u001b[0;36m"
1212
const val WHITE = "\u001b[0;37m"
1313

14-
fun info(any: Any?, newLine: Boolean = true) = print(RESET + (any?.toString() ?: "null") + if (newLine) "\n" else "" + RESET)
15-
fun err(any: Any?, newLine: Boolean = true) = print(RED + (any?.toString() ?: "null") + if (newLine) "\n" else "" + RESET)
16-
fun important(any: Any?, newLine: Boolean = true) = print(PURPLE + (any?.toString() ?: "null") + if (newLine) "\n" else "" + RESET)
14+
fun info(any: Any?, newLine: Boolean = true) = print(RESET + "Bundle: ${any?.toString()}" + if (newLine) "\n" else "" + RESET)
15+
fun err(any: Any?, newLine: Boolean = true) = print(RED + "Bundle: ${any?.toString()}" + if (newLine) "\n" else "" + RESET)
16+
fun important(any: Any?, newLine: Boolean = true) = print(PURPLE + "Bundle: ${any?.toString()}" + if (newLine) "\n" else "" + RESET)

0 commit comments

Comments
 (0)