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

Commit

Permalink
New convenience method to get all keys inside a NBTCompound
Browse files Browse the repository at this point in the history
  • Loading branch information
jglrxavpok committed Nov 7, 2020
1 parent e631625 commit 5204d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ java {
}

group 'org.jglrxavpok.nbt'
version '1.1.4'
version '1.1.5'

repositories {
mavenCentral()
Expand Down
6 changes: 5 additions & 1 deletion src/main/kotlin/org/jglrxavpok/hephaistos/nbt/NBTCompound.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class NBTCompound(): NBT {
return this
}

/**
* Creates a list with the current available keys
*/
fun getKeys(): List<String> = tags.keys.toList()

override fun toSNBT(): String {
val tagStr = tags.map { entry ->
"\"${entry.key.replace("\"", "\\\"")}\":${entry.value.toSNBT()}"
Expand All @@ -71,7 +76,6 @@ class NBTCompound(): NBT {
override fun toString() = toSNBT()



// Convenience methods

/**
Expand Down

0 comments on commit 5204d65

Please sign in to comment.