geforkt von Mirrors/FastAsyncWorldEdit
Allow use of InputStream, this allows schematics to be loaded e.g. as a resource.
Dieser Commit ist enthalten in:
Ursprung
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();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren