Make UUIDIntModifiersMap compatible with savetables
This commit is contained in:
parent
c555b2f318
commit
9924711f31
@ -11,7 +11,7 @@ import java.util.UUID
|
||||
*
|
||||
* This is like Minecraft's Attribute map, except it operate only on whole numbers
|
||||
*/
|
||||
class UUIDIntModifiersMap(private val observer: (Int) -> Unit, private val backingMap: MutableMap<UUID, Int> = HashMap()) : INBTSerializable<ListTag> {
|
||||
class UUIDIntModifiersMap(private val observer: (Int) -> Unit, private val backingMap: MutableMap<UUID, Int> = HashMap()) : INBTSerializable<ListTag?> {
|
||||
var value: Int = 0
|
||||
private set
|
||||
|
||||
@ -78,8 +78,9 @@ class UUIDIntModifiersMap(private val observer: (Int) -> Unit, private val backi
|
||||
}
|
||||
}
|
||||
|
||||
override fun deserializeNBT(nbt: ListTag) {
|
||||
override fun deserializeNBT(nbt: ListTag?) {
|
||||
backingMap.clear()
|
||||
nbt ?: return
|
||||
val old = this.value
|
||||
this.value = 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user