aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-09-29 21:23:39 +0200
committernea <nea@nea.moe>2023-09-29 21:23:39 +0200
commit4d57229b9464e0f85f51df44ce204b5ea866f0dd (patch)
tree16ace6bf6c1fadb5a04817122b4fa56ccac3e8d7 /src/main/kotlin
parent3cbe859eb80c9f8082c99fc3daec8ed93753faf1 (diff)
downloadFirmament-4d57229b9464e0f85f51df44ce204b5ea866f0dd.tar.gz
Firmament-4d57229b9464e0f85f51df44ce204b5ea866f0dd.tar.bz2
Firmament-4d57229b9464e0f85f51df44ce204b5ea866f0dd.zip
Add separate slot locking profile for the Rift
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
index 5de8951..76a719a 100644
--- a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
@@ -6,8 +6,10 @@
package moe.nea.firmament.features.inventory
+import org.lwjgl.glfw.GLFW
import kotlinx.serialization.Serializable
import kotlinx.serialization.serializer
+import net.minecraft.entity.player.PlayerInventory
import moe.nea.firmament.events.HandledScreenKeyPressedEvent
import moe.nea.firmament.events.IsSlotProtectedEvent
import moe.nea.firmament.events.SlotRenderEvents
@@ -16,9 +18,8 @@ import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.mixins.accessor.AccessorHandledScreen
import moe.nea.firmament.util.CommonSoundEffects
import moe.nea.firmament.util.MC
+import moe.nea.firmament.util.SBData
import moe.nea.firmament.util.data.ProfileSpecificDataHolder
-import net.minecraft.entity.player.PlayerInventory
-import org.lwjgl.glfw.GLFW
object SlotLocking : FirmamentFeature {
override val identifier: String
@@ -27,6 +28,7 @@ object SlotLocking : FirmamentFeature {
@Serializable
data class Data(
val lockedSlots: MutableSet<Int> = mutableSetOf(),
+ val lockedSlotsRift: MutableSet<Int> = mutableSetOf(),
)
object TConfig : ManagedConfig(identifier) {
@@ -34,11 +36,17 @@ object SlotLocking : FirmamentFeature {
}
override val config: TConfig
- get() = TConfig
+ get() = TConfig
object DConfig : ProfileSpecificDataHolder<Data>(serializer(), "locked-slots", ::Data)
- val lockedSlots get() = DConfig.data?.lockedSlots
+ val lockedSlots
+ get() = when (SBData.skyblockLocation) {
+ "rift" -> DConfig.data?.lockedSlotsRift
+ null -> null
+ else -> DConfig.data?.lockedSlots
+ }
+
override fun onLoad() {
HandledScreenKeyPressedEvent.subscribe {
if (!it.matches(TConfig.lock)) return@subscribe