Package net.kyori.adventure.nbt
Class TagStringIO.Builder
java.lang.Object
net.kyori.adventure.nbt.TagStringIO.Builder
- Enclosing class:
- TagStringIO
public static class TagStringIO.Builder extends Object
Builder for a SNBT I/O handler.
- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description @NonNull TagStringIO.BuilderacceptLegacy(boolean legacy)Configure whether or not the resulting IO configuration will accept legacy-formatted data.@NonNull TagStringIObuild()Create a new IO configuration from this builder.@NonNull TagStringIO.BuilderemitLegacy(boolean legacy)Configure whether or not the resulting IO configuration will emit legacy-formatted data.@NonNull TagStringIO.Builderindent(int spaces)Set the indent for new levels of pretty-printing.@NonNull TagStringIO.BuilderindentTab(int tabs)Set the indent for new levels of pretty-printing.
-
Method Details
-
indent
Set the indent for new levels of pretty-printing.Providing a level of
0will disable pretty-printing- Parameters:
spaces- Spaces to indent each level with- Returns:
- this builder
- Since:
- 4.0.0
-
indentTab
Set the indent for new levels of pretty-printing.Providing a level of
0will disable pretty-printing- Parameters:
tabs- Tabs to indent each level with- Returns:
- this builder
- Since:
- 4.0.0
-
acceptLegacy
Configure whether or not the resulting IO configuration will accept legacy-formatted data.The legacy format was used in versions of Minecraft prior to 1.13
Be aware that because the legacy int array and modern list are ambiguous with each other, the deserializer will always return legacy-format integer arrays as a list tag.
- Parameters:
legacy- whether to accept legacy formatting- Returns:
- this builder
- Since:
- 4.0.0
-
emitLegacy
Configure whether or not the resulting IO configuration will emit legacy-formatted data.- Parameters:
legacy- whether to emit legacy formatting- Returns:
- this builder
- Since:
- 4.0.0
-
build
Create a new IO configuration from this builder.- Returns:
- new IO configuration
- Since:
- 4.0.0
-