From df6a14f2b1a6b37e733ba86a4a51485b64c6116a Mon Sep 17 00:00:00 2001 From: xtex Date: Sun, 30 Jul 2023 11:37:03 +0800 Subject: [PATCH] feat: save playerData when possible --- .../main/kotlin/quaedam/projection/music/SmartInstrument.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/kotlin/quaedam/projection/music/SmartInstrument.kt b/common/src/main/kotlin/quaedam/projection/music/SmartInstrument.kt index 76b54f1..bce4353 100644 --- a/common/src/main/kotlin/quaedam/projection/music/SmartInstrument.kt +++ b/common/src/main/kotlin/quaedam/projection/music/SmartInstrument.kt @@ -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()) }