Skip to content

Commit

Permalink
fix: writeNbt CastException due to Tag being instance of StringTag
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jan 15, 2024
1 parent cb4c868 commit 87f3472
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ class EmojyNMSHandler : IEmojyNMSHandler {

override fun writeNbt(compound: Tag?): FriendlyByteBuf {
return super.writeNbt(compound?.apply {
transform(this as CompoundTag, EmojyNMSHandlers.transformer())
when (this) {
is CompoundTag -> transform(this, EmojyNMSHandlers.transformer())
is StringTag -> transform(this, EmojyNMSHandlers.transformer())
}
})
}

Expand Down

0 comments on commit 87f3472

Please sign in to comment.