Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 5204d65

Browse files
committed
New convenience method to get all keys inside a NBTCompound
1 parent e631625 commit 5204d65

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ java {
1010
}
1111

1212
group 'org.jglrxavpok.nbt'
13-
version '1.1.4'
13+
version '1.1.5'
1414

1515
repositories {
1616
mavenCentral()

src/main/kotlin/org/jglrxavpok/hephaistos/nbt/NBTCompound.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ class NBTCompound(): NBT {
6161
return this
6262
}
6363

64+
/**
65+
* Creates a list with the current available keys
66+
*/
67+
fun getKeys(): List<String> = tags.keys.toList()
68+
6469
override fun toSNBT(): String {
6570
val tagStr = tags.map { entry ->
6671
"\"${entry.key.replace("\"", "\\\"")}\":${entry.value.toSNBT()}"
@@ -71,7 +76,6 @@ class NBTCompound(): NBT {
7176
override fun toString() = toSNBT()
7277

7378

74-
7579
// Convenience methods
7680

7781
/**

0 commit comments

Comments
 (0)