mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-09-06 15:58:20 +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.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -57,9 +58,7 @@ public class MCEditSchematicFormat extends SchematicFormat {
|
|||||||
super("MCEdit", "mcedit", "mce");
|
super("MCEdit", "mcedit", "mce");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public CuboidClipboard load(InputStream stream) throws IOException, DataException {
|
||||||
public CuboidClipboard load(File file) throws IOException, DataException {
|
|
||||||
FileInputStream stream = new FileInputStream(file);
|
|
||||||
NBTInputStream nbtStream = new NBTInputStream(
|
NBTInputStream nbtStream = new NBTInputStream(
|
||||||
new GZIPInputStream(stream));
|
new GZIPInputStream(stream));
|
||||||
|
|
||||||
@ -194,6 +193,11 @@ public class MCEditSchematicFormat extends SchematicFormat {
|
|||||||
return clipboard;
|
return clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CuboidClipboard load(File file) throws IOException, DataException {
|
||||||
|
return load(new FileInputStream(file));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(CuboidClipboard clipboard, File file) throws IOException, DataException {
|
public void save(CuboidClipboard clipboard, File file) throws IOException, DataException {
|
||||||
int width = clipboard.getWidth();
|
int width = clipboard.getWidth();
|
||||||
|
Loading…
Reference in New Issue
Block a user