From 0d9e79f4aed6f1e4609b62d5515b9d808dcb645b Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 6 May 2018 16:32:50 +1000 Subject: [PATCH] Fixes #994 --- .../sk89q/worldedit/command/GenerationCommands.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index 6d876b74..eb147f0a 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -31,13 +31,7 @@ import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.MutableBlockVector; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.RegionFunction; @@ -117,7 +111,7 @@ public class GenerationCommands extends MethodCommands { @Command( aliases = {"/image", "/img"}, desc = "Generate an image", - usage = " [randomize=true] [complexity=100] [dimensions]", + usage = " [randomize=true] [complexity=100] [dimensions=100,100]", min = 1, max = 4 ) @@ -149,7 +143,8 @@ public class GenerationCommands extends MethodCommands { int color = finalImage.getRGB(x, z); BaseBlock block = tu.getNearestBlock(color); count[0]++; - return editSession.setBlockFast(pos, block); + if (block != null) return editSession.setBlockFast(pos, block); + return false; } catch (Throwable e) { e.printStackTrace(); }