1515 */
1616package org .glavo .nbt .tag ;
1717
18+ import org .glavo .nbt .MinecraftEdition ;
1819import org .glavo .nbt .NBTElement ;
1920import org .glavo .nbt .internal .input .InputSource ;
2021import org .glavo .nbt .internal .input .NBTReader ;
@@ -51,11 +52,11 @@ public sealed abstract class Tag implements NBTElement
5152 }
5253
5354 public static Tag readTag (InputStream inputStream ) throws IOException {
54- return readTag (inputStream , ByteOrder . BIG_ENDIAN );
55+ return readTag (inputStream , MinecraftEdition . JAVA_EDITION );
5556 }
5657
57- public static Tag readTag (InputStream inputStream , ByteOrder byteOrder ) throws IOException {
58- try (var reader = new NBTReader (new InputSource .OfInputStream (inputStream , false ), byteOrder )) {
58+ public static Tag readTag (InputStream inputStream , MinecraftEdition edition ) throws IOException {
59+ try (var reader = new NBTReader (new InputSource .OfInputStream (inputStream , false ), edition )) {
5960 Tag tag = readTag (reader );
6061 if (tag == null ) {
6162 throw new IOException ("No tag found" );
@@ -65,11 +66,11 @@ public static Tag readTag(InputStream inputStream, ByteOrder byteOrder) throws I
6566 }
6667
6768 public static CompoundTag <?> readCompoundTag (InputStream inputStream ) throws IOException {
68- return readCompoundTag (inputStream , ByteOrder . BIG_ENDIAN );
69+ return readCompoundTag (inputStream , MinecraftEdition . JAVA_EDITION );
6970 }
7071
71- public static CompoundTag <?> readCompoundTag (InputStream inputStream , ByteOrder byteOrder ) throws IOException {
72- Tag rootTag = readTag (inputStream , byteOrder );
72+ public static CompoundTag <?> readCompoundTag (InputStream inputStream , MinecraftEdition edition ) throws IOException {
73+ Tag rootTag = readTag (inputStream , edition );
7374 if (rootTag instanceof CompoundTag <?> compoundTag ) {
7475 return compoundTag ;
7576 } else {
@@ -124,11 +125,11 @@ public int getIndex() {
124125 }
125126
126127 public void writeTo (OutputStream outputStream ) throws IOException {
127- writeTo (outputStream , ByteOrder . BIG_ENDIAN );
128+ writeTo (outputStream , MinecraftEdition . JAVA_EDITION );
128129 }
129130
130- public void writeTo (OutputStream outputStream , ByteOrder byteOrder ) throws IOException {
131- try (var writer = new NBTWriter (outputStream , byteOrder )) {
131+ public void writeTo (OutputStream outputStream , MinecraftEdition edition ) throws IOException {
132+ try (var writer = new NBTWriter (outputStream , edition )) {
132133 writer .writeTag (this );
133134 }
134135 }
0 commit comments