diff --git a/Core/build.gradle b/Core/build.gradle index 82f6abd3a..3949c948e 100644 --- a/Core/build.gradle +++ b/Core/build.gradle @@ -11,7 +11,7 @@ dependencies { testCompileOnly("org.projectlombok:lombok:1.18.6") annotationProcessor("org.projectlombok:lombok:1.18.6") testAnnotationProcessor("org.projectlombok:lombok:1.18.6") - + implementation 'net.kyori:text-adapter-bukkit:3.0.2' implementation 'com.github.Sauilitired:Jenkins4J:2.0-SNAPSHOT' implementation 'com.squareup.okhttp3:okhttp:3.14.0' implementation 'com.squareup.okio:okio:2.2.2' diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java index d6df9d003..6ce59fe6c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java @@ -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 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))); diff --git a/build.gradle b/build.gradle index dddfa3ffd..c96224e82 100644 --- a/build.gradle +++ b/build.gradle @@ -67,6 +67,7 @@ subprojects { exclude(module: 'mockito-core') exclude(module: 'dummypermscompat') } + implementation 'net.kyori:text-api:3.0.0' //Minecraft uses Guava 21 as of 1.13. compile 'com.google.guava:guava:21.0' compileOnly 'org.jetbrains:annotations:17.0.0'