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 java.lang.Object
Builder for a SNBT I/O handler.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull TagStringIO.Builder
acceptLegacy(boolean legacy)
Configure whether or not the resulting IO configuration will accept legacy-formatted data.@NotNull TagStringIO
build()
Create a new IO configuration from this builder.@NotNull TagStringIO.Builder
emitLegacy(boolean legacy)
Configure whether or not the resulting IO configuration will emit legacy-formatted data.@NotNull TagStringIO.Builder
indent(int spaces)
Set the indent for new levels of pretty-printing.@NotNull TagStringIO.Builder
indentTab(int tabs)
Set the indent for new levels of pretty-printing.
-
-
-
Method Detail
-
indent
@NotNull public @NotNull TagStringIO.Builder indent(int spaces)
Set the indent for new levels of pretty-printing.Providing a level of
0
will disable pretty-printing- Parameters:
spaces
- Spaces to indent each level with- Returns:
- this builder
- Since:
- 4.0.0
-
indentTab
@NotNull public @NotNull TagStringIO.Builder indentTab(int tabs)
Set the indent for new levels of pretty-printing.Providing a level of
0
will disable pretty-printing- Parameters:
tabs
- Tabs to indent each level with- Returns:
- this builder
- Since:
- 4.0.0
-
acceptLegacy
@NotNull public @NotNull TagStringIO.Builder acceptLegacy(boolean legacy)
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
@NotNull public @NotNull TagStringIO.Builder emitLegacy(boolean legacy)
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
@NotNull public @NotNull TagStringIO build()
Create a new IO configuration from this builder.- Returns:
- new IO configuration
- Since:
- 4.0.0
-
-