Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit 30c7cc6

Browse files
committed
docs: add javadoc
1 parent 1c2e9e5 commit 30c7cc6

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/main/java/net/crystalgames/scaffolding/Scaffolding.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import net.crystalgames.scaffolding.schematic.Schematic;
55
import net.crystalgames.scaffolding.schematic.impl.MCEditSchematic;
66
import net.crystalgames.scaffolding.schematic.impl.SpongeSchematic;
7+
import org.jetbrains.annotations.NotNull;
8+
import org.jetbrains.annotations.Nullable;
79
import org.jglrxavpok.hephaistos.nbt.*;
810

911
import java.io.*;
@@ -17,7 +19,7 @@ public class Scaffolding {
1719
* @throws IOException if the input stream is invalid
1820
* @throws NBTException if the schematic is invalid
1921
*/
20-
public static Schematic fromStream(InputStream inputStream) throws IOException, NBTException {
22+
public static @Nullable Schematic fromStream(@NotNull InputStream inputStream) throws IOException, NBTException {
2123
NBTReader reader = new NBTReader(inputStream, CompressedProcesser.GZIP);
2224
Pair<String, NBT> pair = reader.readNamed();
2325
NBTCompound nbtTag = (NBTCompound) pair.getSecond();
@@ -34,7 +36,7 @@ public static Schematic fromStream(InputStream inputStream) throws IOException,
3436
* @throws IOException if the file is invalid
3537
* @throws NBTException if the schematic is invalid
3638
*/
37-
public static Schematic fromFile(File file) throws IOException, NBTException {
39+
public static @Nullable Schematic fromFile(@NotNull File file) throws IOException, NBTException {
3840
if (!file.exists()) throw new FileNotFoundException("Invalid Schematic: File does not exist");
3941
return fromStream(new FileInputStream(file));
4042
}

src/main/java/net/crystalgames/scaffolding/schematic/impl/MCEditSchematic.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,20 @@ public class MCEditSchematic extends AbstractSchematic {
3030

3131
private boolean read = false;
3232

33+
/**
34+
* Creates an MCEdit schematic from an input stream.
35+
* @param inputStream the input stream
36+
* @throws IOException if the input stream is invalid
37+
* @throws NBTException if the schematic is invalid
38+
*/
3339
public MCEditSchematic(InputStream inputStream) throws IOException, NBTException {
3440
super(inputStream);
3541
}
3642

43+
/**
44+
* Creates an MCEdit schematic from NBT.
45+
* @param nbtTag the NBT tag
46+
*/
3747
public MCEditSchematic(NBTCompound nbtTag) {
3848
super(nbtTag);
3949
}

src/main/java/net/crystalgames/scaffolding/schematic/impl/SpongeSchematic.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,20 @@ public class SpongeSchematic extends AbstractSchematic {
2929

3030
private boolean read = false;
3131

32+
/**
33+
* Creates a Sponge schematic from an input stream.
34+
* @param inputStream the input stream
35+
* @throws IOException if the input stream is invalid
36+
* @throws NBTException if the schematic is invalid
37+
*/
3238
public SpongeSchematic(InputStream inputStream) throws IOException, NBTException {
3339
super(inputStream);
3440
}
3541

42+
/**
43+
* Creates a Sponge schematic from NBT.
44+
* @param nbtTag the NBT tag
45+
*/
3646
public SpongeSchematic(NBTCompound nbtTag) {
3747
super(nbtTag);
3848
}

0 commit comments

Comments
 (0)