feat: Add *base64 and *json nbt path matchers

This commit is contained in:
Linnea Gräf
2025-05-04 14:18:24 +02:00
parent afa128e8c6
commit 3743ae88d9
3 changed files with 80 additions and 3 deletions

View File

@@ -1,7 +1,14 @@
package moe.nea.firmament.util
import java.util.Base64
object Base64Util {
fun decodeString(str: String): String {
return Base64.getDecoder().decode(str.padToValidBase64())
.decodeToString()
}
fun String.padToValidBase64(): String {
val align = this.length % 4
if (align == 0) return this