use of com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader in project FastAsyncWorldEdit by IntellectualSites.
the class FaweDelegateSchematicHandler method getSchematic.
public Schematic getSchematic(@Nonnull InputStream is) {
try {
FastSchematicReader schematicReader = new FastSchematicReader(new NBTInputStream(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(is)))));
Clipboard clip = schematicReader.read();
return new Schematic(clip);
} catch (IOException e) {
if (e instanceof EOFException) {
e.printStackTrace();
return null;
}
try {
SpongeSchematicReader schematicReader = new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
Clipboard clip = schematicReader.read();
return new Schematic(clip);
} catch (IOException e2) {
if (e2 instanceof EOFException) {
e.printStackTrace();
return null;
}
try {
MCEditSchematicReader schematicReader = new MCEditSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
Clipboard clip = schematicReader.read();
return new Schematic(clip);
} catch (IOException e3) {
LOGGER.warn("{} | {} : {}", is, is.getClass().getCanonicalName(), e.getMessage());
e.printStackTrace();
}
}
}
return null;
}
use of com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader in project PlotSquared by IntellectualSites.
the class SchematicHandler method getSchematic.
public Schematic getSchematic(@NonNull InputStream is) {
try {
SpongeSchematicReader schematicReader = new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
Clipboard clip = schematicReader.read();
return new Schematic(clip);
} catch (IOException ignored) {
try {
MCEditSchematicReader schematicReader = new MCEditSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
Clipboard clip = schematicReader.read();
return new Schematic(clip);
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
Aggregations