
usedBytes NBT tag persists on emptied Super Storage Cells
Zombie42399 opened this issue ยท 0 comments
Like the Title says, the usedBytes NBT tag persists on emptied Super Storage Cells. I am running it on forge 1.20.1.
I believe the issue lies starting at line 183 in src/main/kotlin/com/the9grounds/aeadditions/me/storage/SuperCellInventory.kt
if (computedUsedBytes == 0L) {
getTag()!!.remove(ITEM_COUNT_TAG)
} else {
getTag()!!.putLong(ITEM_COUNT_TAG, computedUsedBytes)
getTag()!!.putLong("usedBytes", computedUsedBytes)
}
The tag is added but never removed like the item count tag. This behavior is also inconsistent with vanilla ME Storage Cells.
Suggested fix, Add getTag()!!.remove("usedBytes") after line 184.
Example:
if (computedUsedBytes == 0L) {
getTag()!!.remove(ITEM_COUNT_TAG)
getTag()!!.remove("usedBytes")
} else {
getTag()!!.putLong(ITEM_COUNT_TAG, computedUsedBytes)
getTag()!!.putLong("usedBytes", computedUsedBytes)
}