2019-06-28 17:55:20 -04:00
|
|
|
CLASS net/minecraft/class_2507 net/minecraft/nbt/NbtIo
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT A set of utility functions for reading, writing, and scanning NBT files.
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT Methods that do not require {@link NbtSizeTracker} accept any bytes of data,
|
|
|
|
COMMENT provided that its depth does not exceed {@value NbtSizeTracker#DEFAULT_MAX_DEPTH}.
|
2023-11-11 08:58:28 -05:00
|
|
|
COMMENT
|
2023-11-21 07:24:38 -05:00
|
|
|
COMMENT <p>When {@linkplain DataOutput#writeUTF writing an invalid string}, methods in
|
2023-11-11 08:58:28 -05:00
|
|
|
COMMENT this class will write an empty string instead of crashing, with the exception of
|
|
|
|
COMMENT {@link #writeUnsafe} which throws instead.
|
|
|
|
FIELD field_47513 OPEN_OPTIONS [Ljava/nio/file/OpenOption;
|
2023-08-05 19:18:31 -04:00
|
|
|
METHOD method_10625 readCompound (Ljava/io/DataInput;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2487;
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT Reads an NBT compound from {@code input}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT compound from the input
|
|
|
|
COMMENT @throws IOException if the IO operation fails or if the root NBT element is
|
|
|
|
COMMENT not a compound
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the {@code tracker}'s validation fails
|
|
|
|
ARG 0 input
|
|
|
|
ARG 1 tracker
|
|
|
|
METHOD method_10626 readElement (Ljava/io/DataInput;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2520;
|
2019-06-28 17:55:20 -04:00
|
|
|
ARG 0 input
|
2020-06-24 12:34:48 -04:00
|
|
|
ARG 1 tracker
|
2023-08-05 19:18:31 -04:00
|
|
|
METHOD method_10627 readCompound (Ljava/io/DataInput;)Lnet/minecraft/class_2487;
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT Reads an NBT compound from {@code input}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT compound from the input
|
|
|
|
COMMENT @throws IOException if the IO operation fails or if the root NBT element is
|
|
|
|
COMMENT not a compound
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the NBT is too deep
|
2020-08-14 16:30:20 -04:00
|
|
|
ARG 0 input
|
2023-08-05 19:18:31 -04:00
|
|
|
METHOD method_10628 writeCompound (Lnet/minecraft/class_2487;Ljava/io/DataOutput;)V
|
|
|
|
COMMENT Writes the {@code nbt} to {@code output}.
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT @see #write(NbtCompound, Path)
|
2022-05-11 14:28:23 -04:00
|
|
|
ARG 0 nbt
|
2018-11-29 15:36:56 -05:00
|
|
|
ARG 1 output
|
2023-10-18 11:42:03 -04:00
|
|
|
METHOD method_10629 readCompressed (Ljava/io/InputStream;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2487;
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT Reads an NBT compound from Gzip-compressed {@code stream}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT compound from the stream
|
|
|
|
COMMENT @throws IOException if the IO operation fails or if the root NBT element is
|
|
|
|
COMMENT not a compound
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the NBT is too deep
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #readCompressed(Path, NbtSizeTracker)
|
2019-06-28 17:55:20 -04:00
|
|
|
ARG 0 stream
|
2023-10-19 09:43:23 -04:00
|
|
|
ARG 1 tagSizeTracker
|
2023-11-01 12:08:21 -04:00
|
|
|
METHOD method_10630 write (Lnet/minecraft/class_2487;Ljava/nio/file/Path;)V
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT Writes the {@code nbt} to the file at {@code path}.
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2024-03-25 19:08:09 -04:00
|
|
|
COMMENT @see #writeCompound(NbtCompound, DataOutput)
|
2022-05-11 14:28:23 -04:00
|
|
|
ARG 0 nbt
|
2023-11-02 12:30:30 -04:00
|
|
|
ARG 1 path
|
2023-11-11 08:58:28 -05:00
|
|
|
METHOD method_10631 writeUnsafe (Lnet/minecraft/class_2520;Ljava/io/DataOutput;)V
|
2023-08-05 19:18:31 -04:00
|
|
|
COMMENT Writes the {@code nbt} to {@code output}. The output is the byte indicating
|
|
|
|
COMMENT the element type, followed by {@linkplain DataOutput#writeUTF an empty string}
|
|
|
|
COMMENT and the NBT data.
|
|
|
|
COMMENT
|
2023-11-11 08:58:28 -05:00
|
|
|
COMMENT <p>When {@linkplain DataOutput#writeUTF writing an invalid string}, this
|
|
|
|
COMMENT method will <strong>throw an error</strong>, unlike other methods.
|
|
|
|
COMMENT
|
2023-08-05 19:18:31 -04:00
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #read(DataInput, NbtSizeTracker)
|
2023-08-05 19:18:31 -04:00
|
|
|
COMMENT @see #writeForPacket(NbtElement, DataOutput)
|
2023-11-11 08:58:28 -05:00
|
|
|
COMMENT @see #write(NbtElement, DataOutput)
|
2022-05-11 14:28:23 -04:00
|
|
|
ARG 0 nbt
|
2018-11-29 15:36:56 -05:00
|
|
|
ARG 1 output
|
2023-11-01 12:08:21 -04:00
|
|
|
METHOD method_10633 read (Ljava/nio/file/Path;)Lnet/minecraft/class_2487;
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT Reads an NBT compound from the file at{@code path}.
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT compound from the file, or {@code null} if the file does not exist
|
|
|
|
COMMENT @throws IOException if the IO operation fails or if the root NBT element is
|
|
|
|
COMMENT not a compound
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the NBT is too deep
|
2023-11-02 12:30:30 -04:00
|
|
|
ARG 0 path
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_10634 writeCompressed (Lnet/minecraft/class_2487;Ljava/io/OutputStream;)V
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT Writes the Gzip-compressed {@code nbt} to {@code stream}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT @see #writeCompressed(NbtCompound, Path)
|
2022-05-11 14:28:23 -04:00
|
|
|
ARG 0 nbt
|
2019-06-28 17:55:20 -04:00
|
|
|
ARG 1 stream
|
2023-11-01 12:08:21 -04:00
|
|
|
METHOD method_30613 readCompressed (Ljava/nio/file/Path;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2487;
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT Reads an NBT compound from Gzip-compressed file at {@code path}.
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT compound from the file
|
|
|
|
COMMENT @throws IOException if the IO operation fails or if the root NBT element is
|
|
|
|
COMMENT not a compound
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the NBT is too deep
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #readCompressed(InputStream, NbtSizeTracker)
|
2023-11-02 12:30:30 -04:00
|
|
|
ARG 0 path
|
2023-10-19 09:43:23 -04:00
|
|
|
ARG 1 tagSizeTracker
|
2023-11-01 12:08:21 -04:00
|
|
|
METHOD method_30614 writeCompressed (Lnet/minecraft/class_2487;Ljava/nio/file/Path;)V
|
2023-11-02 12:30:30 -04:00
|
|
|
COMMENT Writes the Gzip-compressed {@code nbt} to the file at {@code path}.
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
|
|
|
COMMENT @see #writeCompressed(NbtCompound, OutputStream)
|
|
|
|
ARG 0 nbt
|
2023-11-02 12:30:30 -04:00
|
|
|
ARG 1 path
|
2023-09-12 09:17:57 -04:00
|
|
|
METHOD method_39855 scan (Ljava/io/DataInput;Lnet/minecraft/class_6836;Lnet/minecraft/class_2505;)V
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT Scans the NBT input using {@code scanner}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This method does not return the scan result; the user is expected
|
|
|
|
COMMENT to call the appropriate method of the {@link NbtScanner} subclasses, such as
|
|
|
|
COMMENT {@link net.minecraft.nbt.scanner.NbtCollector#getRoot()}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the {@code tracker}'s validation fails
|
2021-11-19 05:48:18 -05:00
|
|
|
ARG 0 input
|
2022-02-09 06:33:27 -05:00
|
|
|
ARG 1 scanner
|
2023-09-12 10:39:11 -04:00
|
|
|
ARG 2 tracker
|
2023-11-01 12:08:21 -04:00
|
|
|
METHOD method_40057 scanCompressed (Ljava/nio/file/Path;Lnet/minecraft/class_6836;Lnet/minecraft/class_2505;)V
|
2022-02-09 06:33:27 -05:00
|
|
|
COMMENT Scans the compressed NBT file using {@code scanner}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This method does not return the scan result; the user is expected
|
|
|
|
COMMENT to call the appropriate method of the {@link NbtScanner} subclasses, such as
|
|
|
|
COMMENT {@link net.minecraft.nbt.scanner.NbtCollector#getRoot()}.
|
|
|
|
COMMENT
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the {@code tracker}'s validation fails
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #scanCompressed(InputStream, NbtScanner, NbtSizeTracker)
|
2023-11-02 12:30:30 -04:00
|
|
|
ARG 0 path
|
2022-02-09 06:33:27 -05:00
|
|
|
ARG 1 scanner
|
2023-09-12 10:39:11 -04:00
|
|
|
ARG 2 tracker
|
2023-09-12 09:17:57 -04:00
|
|
|
METHOD method_40058 scanCompressed (Ljava/io/InputStream;Lnet/minecraft/class_6836;Lnet/minecraft/class_2505;)V
|
2022-02-09 06:33:27 -05:00
|
|
|
COMMENT Scans the compressed NBT stream using {@code scanner}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This method does not return the scan result; the user is expected
|
|
|
|
COMMENT to call the appropriate method of the {@link NbtScanner} subclasses, such as
|
|
|
|
COMMENT {@link net.minecraft.nbt.scanner.NbtCollector#getRoot()}.
|
|
|
|
COMMENT
|
2022-05-11 14:28:23 -04:00
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the {@code tracker}'s validation fails
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #scanCompressed(Path, NbtScanner, NbtSizeTracker)
|
2022-02-09 06:33:27 -05:00
|
|
|
ARG 0 stream
|
|
|
|
ARG 1 scanner
|
2023-09-12 10:39:11 -04:00
|
|
|
ARG 2 tracker
|
2022-02-09 06:33:27 -05:00
|
|
|
METHOD method_40059 decompress (Ljava/io/InputStream;)Ljava/io/DataInputStream;
|
|
|
|
COMMENT {@return a new input stream that decompresses the input {@code stream}}
|
|
|
|
ARG 0 stream
|
2023-09-12 10:39:11 -04:00
|
|
|
METHOD method_52892 readElement (Ljava/io/DataInput;Lnet/minecraft/class_2505;B)Lnet/minecraft/class_2520;
|
2023-08-05 19:18:31 -04:00
|
|
|
ARG 0 input
|
2023-09-12 10:39:11 -04:00
|
|
|
ARG 1 tracker
|
|
|
|
ARG 2 typeId
|
2023-08-05 19:18:31 -04:00
|
|
|
METHOD method_52893 writeForPacket (Lnet/minecraft/class_2520;Ljava/io/DataOutput;)V
|
|
|
|
COMMENT Writes the {@code nbt} to {@code output}. The output is the byte indicating
|
|
|
|
COMMENT the element type, followed by the NBT data.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote In vanilla, this is used exclusively in networking.
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #read(DataInput, NbtSizeTracker)
|
2023-08-05 19:18:31 -04:00
|
|
|
COMMENT @see #write(NbtElement, DataOutput)
|
|
|
|
ARG 0 nbt
|
|
|
|
ARG 1 output
|
|
|
|
METHOD method_52894 read (Ljava/io/DataInput;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2520;
|
|
|
|
COMMENT Reads an NBT element from {@code input}. Unlike {@link
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT #readCompound(DataInput, NbtSizeTracker)}, the element does not have to
|
2023-08-05 19:18:31 -04:00
|
|
|
COMMENT be a compound.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the NBT element from the input
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-09-12 10:39:11 -04:00
|
|
|
COMMENT @throws NbtSizeValidationException if the {@code tracker}'s validation fails
|
2023-08-05 19:18:31 -04:00
|
|
|
ARG 0 input
|
|
|
|
ARG 1 tracker
|
2023-11-02 12:30:30 -04:00
|
|
|
METHOD method_54906 compress (Ljava/io/OutputStream;)Ljava/io/DataOutputStream;
|
|
|
|
COMMENT {@return a new output stream that compresses the input {@code stream}}
|
|
|
|
ARG 0 stream
|
2023-11-11 08:58:28 -05:00
|
|
|
METHOD method_55324 write (Lnet/minecraft/class_2520;Ljava/io/DataOutput;)V
|
|
|
|
COMMENT Writes the {@code nbt} to {@code output}. The output is the byte indicating
|
|
|
|
COMMENT the element type, followed by {@linkplain DataOutput#writeUTF an empty string}
|
|
|
|
COMMENT and the NBT data.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>When {@linkplain DataOutput#writeUTF writing an invalid string}, this
|
|
|
|
COMMENT method will write an empty string instead of crashing.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IOException if the IO operation fails
|
2023-12-13 08:00:51 -05:00
|
|
|
COMMENT @see #read(DataInput, NbtSizeTracker)
|
2023-11-11 08:58:28 -05:00
|
|
|
COMMENT @see #writeForPacket(NbtElement, DataOutput)
|
|
|
|
COMMENT @see #writeUnsafe(NbtElement, DataOutput)
|
|
|
|
ARG 0 nbt
|
|
|
|
ARG 1 output
|
|
|
|
CLASS class_9003 InvalidUtfSkippingDataOutput
|