From 275a2fa887c9c2851458efc3c850ed5a7e3e6096 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 24 Oct 2018 16:33:04 +1000 Subject: [PATCH] Fixed a few bad javadoc imports --- .../src/main/java/com/sk89q/worldedit/WorldEdit.java | 11 +++++++---- .../sk89q/worldedit/command/SchematicCommands.java | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 69a62a5c2..cc2f9a440 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -38,6 +38,8 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.PlatformManager; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.scripting.CraftScriptContext; import com.sk89q.worldedit.scripting.CraftScriptEngine; import com.sk89q.worldedit.scripting.RhinoCraftScriptEngine; @@ -68,6 +70,7 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import javax.annotation.Nullable; import javax.script.ScriptException; /** @@ -164,7 +167,7 @@ public class WorldEdit { } /** - * Get the mask factory from which new {@link com.sk89q.worldedit.function.mask.Mask}s + * Get the mask factory from which new {@link Mask}s * can be constructed. * * @return the mask factory @@ -174,7 +177,7 @@ public class WorldEdit { } /** - * Get the pattern factory from which new {@link com.sk89q.worldedit.function.pattern.Pattern}s + * Get the pattern factory from which new {@link Pattern}s * can be constructed. * * @return the pattern factory @@ -240,12 +243,12 @@ public class WorldEdit { * @return a file * @throws FilenameException thrown if the filename is invalid */ - private File getSafeFile(Player player, File dir, String filename, String defaultExt, String[] extensions, boolean isSave) throws FilenameException { + private File getSafeFile(@Nullable Player player, File dir, String filename, String defaultExt, String[] extensions, boolean isSave) throws FilenameException { if (extensions != null && (extensions.length == 1 && extensions[0] == null)) extensions = null; File f; - if (filename.equals("#")) { + if (filename.equals("#") && player != null) { if (isSave) { f = player.openFileSaveDialog(extensions); } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index affa4b491..bb5ecba27 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; @@ -92,7 +93,7 @@ public class SchematicCommands { LocalConfiguration config = worldEdit.getConfiguration(); File dir = worldEdit.getWorkingDirectoryFile(config.saveDir); - File f = worldEdit.getSafeOpenFile(player, dir, filename, "schematic", ClipboardFormats.getFileExtensionArray()); + File f = worldEdit.getSafeOpenFile(player, dir, filename, BuiltInClipboardFormat.SPONGE_SCHEMATIC.getPrimaryFileExtension(), ClipboardFormats.getFileExtensionArray()); if (!f.exists()) { player.printError("Schematic " + filename + " does not exist!");