Skip to content

NbtIO.writeNbtFile produces ClassCastException #1

Open
@alexsocha

Description

@alexsocha

Version: 3.1.0

Thanks for the really useful library, just noticed an issue when using this method:

NbtIO.writeNbtFile(File("test.mcstructure"), NbtFile("", NbtCompound()), compressed=false, littleEndian=true)

which produces:

Exception in thread "main" java.lang.ClassCastException: class java.io.BufferedOutputStream cannot be cast to class java.io.DataOutputStream (java.io.BufferedOutputStream and java.io.DataOutputStream are in module java.base of loader 'bootstrap')
        at br.com.gamemods.nbtmanipulator.LittleEndianDataOutputStream.<init>(LittleEndianDataOutputStream.kt:15)
        at br.com.gamemods.nbtmanipulator.NbtIO.writeNbtFile(NbtIO.kt:42)
        at br.com.gamemods.nbtmanipulator.NbtIO.writeNbtFile(NbtIO.kt:87)
        at br.com.gamemods.nbtmanipulator.NbtIO.writeNbtFile$default(NbtIO.kt:81)

a similar thing also happens with compressed=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions