From 33ff7fb34cefc1060dbe3475ad7239ca56798e04 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 18 Oct 2010 10:41:56 -0700 Subject: [PATCH] Changed //cyl and //hcyl to use the same code. --- src/WorldEdit.java | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 70855cbb9..258bd420a 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -409,28 +409,21 @@ public class WorldEdit { return true; // Draw a hollow cylinder - } else if (split[0].equalsIgnoreCase("//hcyl")) { + } else if (split[0].equalsIgnoreCase("//hcyl") + || split[0].equalsIgnoreCase("//cyl")) { checkArgs(split, 2, 3, split[0]); BaseBlock block = getBlock(split[1]); int radius = Math.max(1, Integer.parseInt(split[2])); int height = split.length > 3 ? Integer.parseInt(split[3]) : 1; + boolean filled = split[0].equalsIgnoreCase("//cyl"); Vector pos = session.getPlacementPosition(player); - int affected = editSession.makeHollowCylinder(pos, block, radius, height); - player.print(affected + " block(s) have been created."); - - return true; - - // Draw a filled cylinder - } else if (split[0].equalsIgnoreCase("//cyl")) { - checkArgs(split, 2, 3, split[0]); - BaseBlock block = getBlock(split[1]); - int radius = Math.max(1, Integer.parseInt(split[2])); - int height = split.length > 3 ? Integer.parseInt(split[3]) : 1; - - Vector pos = session.getPlacementPosition(player); - int affected = editSession.makeCylinder(pos, block, radius, height); - player.findFreePosition(); + int affected; + if (filled) { + affected = editSession.makeCylinder(pos, block, radius, height); + } else { + affected = editSession.makeHollowCylinder(pos, block, radius, height); + } player.print(affected + " block(s) have been created."); return true;