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

Commit

Permalink
Revert code breaking change when using Kotlin and NBTList
Browse files Browse the repository at this point in the history
  • Loading branch information
jglrxavpok committed Jan 15, 2021
1 parent 7b96f30 commit 126f55a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 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.6'
version '1.1.7'

repositories {
mavenCentral()
Expand Down
13 changes: 2 additions & 11 deletions src/main/kotlin/org/jglrxavpok/hephaistos/nbt/NBTList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ class NBTList<Tag: NBT>(val subtagType: Int): Iterable<Tag>, NBT {
add(tag)
}

operator fun plusAssign(tags: Iterable<Tag>) {
add(tags)
}

/**
* Appends a tag of the end of this list
*/
Expand All @@ -81,11 +77,6 @@ class NBTList<Tag: NBT>(val subtagType: Int): Iterable<Tag>, NBT {
tags += tag
}

/**
* Appends a list of tags to the end of this list
*/
fun add(tags: Iterable<Tag>): Unit = tags.forEach(::add)

/**
* Casts this list to another list type. Can throw a ClassCastException, so be careful
*/
Expand Down Expand Up @@ -130,9 +121,9 @@ class NBTList<Tag: NBT>(val subtagType: Int): Iterable<Tag>, NBT {
}

override fun deepClone() = NBTList<Tag>(subtagType).let {
it += tags.map { element ->
tags.map { element ->
element.deepClone() as Tag
}
}.forEach(it::add)
it
}
}

0 comments on commit 126f55a

Please sign in to comment.