Skip to content

Commit efb69ce

Browse files
committed
Revert mutable list setting
1 parent 47ade72 commit efb69ce

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

common/src/main/kotlin/com/lambda/config/Configurable.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
149149
* The type parameter [T] must either be a primitive type or a type with a registered type adapter in [Lambda.gson].
150150
*
151151
* @param name The unique identifier for the setting.
152-
* @param defaultValue The default [MutableList] value of type [T] for the setting.
152+
* @param defaultValue The default [List] value of type [T] for the setting.
153153
* @param description A brief explanation of the setting's purpose and behavior.
154154
* @param visibility A lambda expression that determines the visibility status of the setting.
155155
*
@@ -162,7 +162,7 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
162162
*/
163163
inline fun <reified T : Any> setting(
164164
name: String,
165-
defaultValue: MutableList<T>,
165+
defaultValue: List<T>,
166166
description: String = "",
167167
noinline visibility: () -> Boolean = { true },
168168
) = ListSetting(name, defaultValue, description, visibility).also {

common/src/main/kotlin/com/lambda/config/settings/collections/ListSetting.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import com.lambda.config.AbstractSetting
77

88
class ListSetting<T>(
99
override val name: String,
10-
defaultValue: MutableList<T>,
10+
defaultValue: List<T>,
1111
description: String,
1212
visibility: () -> Boolean,
13-
) : AbstractSetting<MutableList<T>>(
13+
) : AbstractSetting<List<T>>(
1414
defaultValue,
1515
description,
1616
visibility
1717
) {
1818
override fun loadFromJson(serialized: JsonElement) {
19-
val listType = object : TypeToken<MutableList<T>>() {}.type
19+
val listType = object : TypeToken<List<T>>() {}.type
2020
value = gson.fromJson(serialized, listType)
2121
}
2222
}

common/src/main/kotlin/com/lambda/gui/impl/clickgui/GuiConfigurable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ import com.lambda.gui.impl.clickgui.windows.TagWindow
77

88
object GuiConfigurable : Configurable(GuiConfig) {
99
override val name = "ClickGui"
10-
val windows = setting("windows", mutableListOf<WindowComponent<*>>(TagWindow()))
10+
val windows = setting("windows", listOf<WindowComponent<*>>(TagWindow()))
1111
}

common/src/main/kotlin/com/lambda/module/modules/Packetlogger.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ object Packetlogger : Module(
3737
private val networkSide by setting("Network Side", NetworkSide.ANY, "Side of the network to log packets from")
3838
private val logTicks by setting("Log Ticks", true, "Show game ticks in the log")
3939
private val scope by setting("Scope", Scope.ANY, "Scope of packets to log")
40-
private val whitelist by setting("Whitelist Packets", mutableListOf<String>(), "Packets to whitelist") { scope == Scope.WHITELIST }
41-
private val blacklist by setting("Blacklist Packets", mutableListOf<String>(), "Packets to blacklist") { scope == Scope.BLACKLIST }
40+
private val whitelist by setting("Whitelist Packets", listOf<String>(), "Packets to whitelist") { scope == Scope.WHITELIST }
41+
private val blacklist by setting("Blacklist Packets", listOf<String>(), "Packets to blacklist") { scope == Scope.BLACKLIST }
4242
private val maxRecursionDepth by setting("Max Recursion Depth", 6, 1..10, 1, "Maximum recursion depth for packet serialization")
4343
private val logConcurrent by setting("Build Data Concurrent", false, "Whether to serialize packets concurrently. Will not save packets in chronological order but wont lag the game.")
4444

0 commit comments

Comments
 (0)