From c9314e10ae33d4c1da35e89cad6b98a6260e0ab7 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Fri, 21 Mar 2025 23:34:01 -0300 Subject: bc25: limit player-placed frequency range --- .../kotlin/space/autistic/radio/client/gui/StorageCardEditScreen.kt | 2 +- src/main/kotlin/space/autistic/radio/PirateRadio.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/kotlin/space/autistic/radio/client/gui/StorageCardEditScreen.kt b/src/client/kotlin/space/autistic/radio/client/gui/StorageCardEditScreen.kt index a1dd5d5..6e5da3a 100644 --- a/src/client/kotlin/space/autistic/radio/client/gui/StorageCardEditScreen.kt +++ b/src/client/kotlin/space/autistic/radio/client/gui/StorageCardEditScreen.kt @@ -108,7 +108,7 @@ class StorageCardEditScreen( const val FREQ_WIDTH = 40 const val FREQ_HEIGHT = 20 - val FREQ_REGEX = Regex("^76\\.[8-9]|7[7-9]\\.[0-9]|[8-9][0-9]\\.[0-9]|10[0-7]\\.[0-9]|108\\.0$") + val FREQ_REGEX = Regex("^76\\.[8-9]|7[7-9]\\.[0-9]|[8-9][0-9]\\.[0-9]|100\\.0$") val FREQ_REGEX_CHARACTERS = Regex("^[0-9]*\\.?[0-9]?$") } diff --git a/src/main/kotlin/space/autistic/radio/PirateRadio.kt b/src/main/kotlin/space/autistic/radio/PirateRadio.kt index d463e41..2a57d10 100644 --- a/src/main/kotlin/space/autistic/radio/PirateRadio.kt +++ b/src/main/kotlin/space/autistic/radio/PirateRadio.kt @@ -43,7 +43,7 @@ object PirateRadio : ModInitializer { } val stack = context.player().inventory.getStack(payload.slot) if (stack.isOf(PirateRadioItems.STORAGE_CARD)) { - stack.set(PirateRadioComponents.FREQUENCY, min(1080, max(768, payload.frequency))) + stack.set(PirateRadioComponents.FREQUENCY, min(1000, max(768, payload.frequency))) var text = payload.text if (text.length > 16384) { text = text.substring(0, 16384) -- cgit 1.4.1