Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubenicos committed Feb 20, 2025
1 parent 3b40259 commit ef1bab7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ repositories {
}
dependencies {
implementation 'com.saicone.nbt:nbt:1.0.0'
implementation 'com.saicone.nbt:nbt:1.0.1'
}
```

Expand All @@ -105,7 +105,7 @@ repositories {
}

dependencies {
implementation("com.saicone.nbt:nbt:1.0.0")
implementation("com.saicone.nbt:nbt:1.0.1")
}
```

Expand All @@ -126,7 +126,7 @@ dependencies {
<dependency>
<groupId>com.saicone.nbt</groupId>
<artifactId>nbt</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -201,6 +201,9 @@ InputStream in = Files.newInputStream(Path.of("myfile.nbt"));
// Read from file
Map<String, Object> map;
try (TagInput<Object> input = TagInput.of(new DataInputStream(in))) {
// Input must not be limited while reading a file
input.unlimited();

map = input.readUnnamed();
}
```
Expand Down Expand Up @@ -262,6 +265,9 @@ InputStream in = Files.newInputStream(Path.of("myfile.nbt"));
// Read from file
Map<String, Object> map;
try (TagInput<Object> input = TagInput.of(new ReverseDataInputStream(in))) {
// Input must not be limited while reading a file
input.unlimited();

map = input.readBedrockFile();
}
```
Expand Down Expand Up @@ -319,7 +325,7 @@ Integer level = ZipFormat.zlib().getCompressionLevel(data);
### Other

If you have a `DataOuput` instance, you can also create a delegated class with fallback writing for malformed Strings.
If you have a `DataOuput` instance, you can also create a delegated class with fallback writing for malformatted Strings.
```java
DataOutput output = ...;

Expand All @@ -336,9 +342,9 @@ That's because Minecraft have changed across the time (it's a 15th year-old game
* any, mean a tag, introduced for Java on Minecraft 1.20.2.
* bedrock file, mean a tag written in a bedrock file with its [header](https://wiki.bedrock.dev/nbt/nbt-in-depth.html#bedrock-nbt-file-header).

Following Minecraft format, there's no limit to write with a tag output, but tag input is limited by default with a maximum of 2MB size for tag (due network limitations) and 512 stack depth for nested values (since MC 1.20.2).
Following Minecraft format, there's no limit to write with a tag output, but tag input is limited by default with a maximum of 2MB size for tag (due network limitations) and 512 stack depth for nested values (since MC 1.20.2) to avoid a stack overflow error.

To change that limits you can also modify the recently created TagInput instance, for example:
To change those limits you can also modify the recently created TagInput instance, for example:
```java
TagInput<Object> input = ...;

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=com.saicone.nbt
version=1.0.0
version=1.0.1

0 comments on commit ef1bab7

Please sign in to comment.