feat: save playerData when possible

This commit is contained in:
xtex 2023-07-30 11:37:03 +08:00
parent 89841beeb7
commit df6a14f2b1
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -174,6 +174,9 @@ class SmartInstrumentBlockEntity(pos: BlockPos, state: BlockState) :
override fun saveAdditional(tag: CompoundTag) {
super.saveAdditional(tag)
if (playerData != null) {
tag.put(TAG_MUSIC, playerData!!)
}
if (player != null) {
tag.put(TAG_MUSIC, player!!.toTag())
}