new library in gradle and another change I can't remember.

This commit is contained in:
MattBDev
2019-05-21 18:32:26 -04:00
parent 8ff833de36
commit fe471c3571
3 changed files with 11 additions and 11 deletions

View File

@ -28,6 +28,7 @@ import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BaseBlock;
import org.jetbrains.annotations.NotNull;
import java.io.*;
import java.net.URL;
@ -64,15 +65,16 @@ public abstract class SchematicHandler {
Iterator<Plot> i = plots.iterator();
final Plot plot = i.next();
i.remove();
String o = UUIDHandler.getName(plot.guessOwner());
if (o == null) {
o = "unknown";
String owner = UUIDHandler.getName(plot.guessOwner());
if (owner == null) {
owner = "unknown";
}
final String name;
if (namingScheme == null) {
name = plot.getId().x + ";" + plot.getId().y + ',' + plot.getArea() + ',' + o;
name =
plot.getId().x + ";" + plot.getId().y + ',' + plot.getArea() + ',' + owner;
} else {
name = namingScheme.replaceAll("%owner%", o)
name = namingScheme.replaceAll("%owner%", owner)
.replaceAll("%id%", plot.getId().toString())
.replaceAll("%idx%", plot.getId().x + "")
.replaceAll("%idy%", plot.getId().y + "")
@ -323,7 +325,7 @@ public abstract class SchematicHandler {
return null;
}
public Schematic getSchematic(URL url) {
public Schematic getSchematic(@NotNull URL url) {
try {
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
InputStream is = Channels.newInputStream(rbc);
@ -334,10 +336,7 @@ public abstract class SchematicHandler {
return null;
}
public Schematic getSchematic(InputStream is) {
if (is == null) {
return null;
}
public Schematic getSchematic(@NotNull InputStream is) {
try {
SpongeSchematicReader ssr =
new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is)));