Skip to content

Commit 0d10f1f

Browse files
committed
Allow compilation with JDK8
1 parent 96204cb commit 0d10f1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/net/lovector/ayyther/Ayyther.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.io.FileOutputStream;
77
import java.io.IOException;
88
import java.util.ArrayList;
9+
import java.util.List;
910
import java.util.logging.Logger;
1011

1112
import org.bukkit.World;
@@ -120,7 +121,9 @@ public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
120121
private AyytherGenerator loadGeneratorData(File worldFile, String worldName) throws IOException {
121122
if (worldFile.exists()) {
122123
try (DataInputStream inputStream = new DataInputStream(new FileInputStream(worldFile))) {
123-
return new AyytherGenerator(worldName, inputStream.readAllBytes());
124+
byte[] bytes = new byte[(int) worldFile.length()];
125+
inputStream.read(bytes);
126+
return new AyytherGenerator(worldName, bytes);
124127
} catch (IOException e) {
125128
throw e;
126129
}

0 commit comments

Comments
 (0)