diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt index 6ce5570d5..726a5eab2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt @@ -761,6 +761,11 @@ abstract class MatteryScreen(menu: T, inventory: Inventory, tit const val MAX_ROWS = 6 var lastScroll = 0 - var lastRows by ClientConfig.GUI::EXOPACK_INVENTORY_ROWS + var lastRows: Int + get() = ClientConfig.GUI::EXOPACK_INVENTORY_ROWS.get() + set(value) { + ClientConfig.GUI::EXOPACK_INVENTORY_ROWS.set(value) + ClientConfig.spec.save() + } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt index 98e7277eb..b76938fb9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt @@ -11,7 +11,8 @@ import ru.dbotthepony.mc.otm.core.math.defineDecimal import ru.dbotthepony.mc.otm.core.util.WriteOnce abstract class AbstractConfig(private val configName: String, private val type: ModConfig.Type = ModConfig.Type.SERVER) { - private var spec: ModConfigSpec by WriteOnce() + var spec: ModConfigSpec by WriteOnce() + private set protected val builder = ModConfigSpec.Builder() private var registered = false