3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

Allow use of InputStream, this allows schematics to be loaded e.g. as a resource.

Dieser Commit ist enthalten in:
ItsHarry 2014-01-05 21:07:39 +01:00
Ursprung c25b9a53f2
Commit ae0b2df66e

Datei anzeigen

@ -23,6 +23,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -57,9 +58,7 @@ public class MCEditSchematicFormat extends SchematicFormat {
super("MCEdit", "mcedit", "mce");
}
@Override
public CuboidClipboard load(File file) throws IOException, DataException {
FileInputStream stream = new FileInputStream(file);
public CuboidClipboard load(InputStream stream) throws IOException, DataException {
NBTInputStream nbtStream = new NBTInputStream(
new GZIPInputStream(stream));
@ -194,6 +193,11 @@ public class MCEditSchematicFormat extends SchematicFormat {
return clipboard;
}
@Override
public CuboidClipboard load(File file) throws IOException, DataException {
return load(new FileInputStream(file));
}
@Override
public void save(CuboidClipboard clipboard, File file) throws IOException, DataException {
int width = clipboard.getWidth();