mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Allow use of InputStream, this allows schematics to be loaded e.g. as a resource.
This commit is contained in:
parent
c25b9a53f2
commit
ae0b2df66e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user