Package dev.flavored.bamboo
Class SchematicReader
java.lang.Object
dev.flavored.bamboo.SchematicReader
A
SchematicReader reads a Sponge (v1) schematic.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull SchematicfromNBT(@NotNull net.kyori.adventure.nbt.CompoundBinaryTag root) Reads a schematic from the givenCompoundBinaryTag.@NotNull SchematicReads a schematic from the givenPath.@NotNull SchematicfromStream(@NotNull InputStream stream) Reads a schematic from the givenInputStream.
-
Constructor Details
-
SchematicReader
public SchematicReader()Initializes a new schematic reader.
-
-
Method Details
-
fromPath
Reads a schematic from the givenPath.- Parameters:
path- The path to the schematic file.- Returns:
- The schematic.
- Throws:
IOException- If the schematic could not be read or is invalid.
-
fromStream
@NotNull public @NotNull Schematic fromStream(@NotNull @NotNull InputStream stream) throws IOException Reads a schematic from the givenInputStream.- Parameters:
stream- The input stream.- Returns:
- The schematic.
- Throws:
IOException- If the schematic could not be read or is invalid.
-
fromNBT
@NotNull public @NotNull Schematic fromNBT(@NotNull @NotNull net.kyori.adventure.nbt.CompoundBinaryTag root) throws IOException Reads a schematic from the givenCompoundBinaryTag.- Parameters:
root- The root tag.- Returns:
- The schematic.
- Throws:
IOException- If the schematic is invalid.
-