diff options
Diffstat (limited to 'src/main/kotlin/util/mc/NbtUtil.kt')
| -rw-r--r-- | src/main/kotlin/util/mc/NbtUtil.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/util/mc/NbtUtil.kt b/src/main/kotlin/util/mc/NbtUtil.kt index 2cab1c7..5c47c28 100644 --- a/src/main/kotlin/util/mc/NbtUtil.kt +++ b/src/main/kotlin/util/mc/NbtUtil.kt @@ -1,10 +1,15 @@ package moe.nea.firmament.util.mc +import net.minecraft.component.type.NbtComponent import net.minecraft.nbt.NbtElement import net.minecraft.nbt.NbtList +import moe.nea.firmament.mixins.accessor.AccessorNbtComponent fun Iterable<NbtElement>.toNbtList() = NbtList().also { for (element in this) { it.add(element) } } + +@Suppress("CAST_NEVER_SUCCEEDS") +val NbtComponent.unsafeNbt get() = (this as AccessorNbtComponent).unsafeNbt_firmament |
