From 102a149dbb7398132cbc729d5d56157b9da7664b Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 9 Apr 2013 17:17:15 -0400 Subject: [PATCH] Fix setbiome issue and tweak a few block names. --- src/main/java/com/sk89q/worldedit/WorldEdit.java | 3 +++ src/main/java/com/sk89q/worldedit/blocks/BlockType.java | 4 ++-- .../java/com/sk89q/worldedit/commands/BiomeCommands.java | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/WorldEdit.java b/src/main/java/com/sk89q/worldedit/WorldEdit.java index 968b4185a..a2d0e9c4d 100644 --- a/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -478,6 +478,9 @@ public class WorldEdit { case NETHER_BRICK: data = 6; break; + case QUARTZ_BLOCK: + data = 7; + break; default: throw new InvalidItemException(arg, "Invalid step type '" + typeAndData[1] + "'"); diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 8452841ca..3a404441c 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -179,7 +179,7 @@ public enum BlockType { CARROTS(BlockID.CARROTS, "Carrots", "carrots", "carrotsplant", "carrotsblock"), POTATOES(BlockID.POTATOES, "Potatoes", "patatoes", "potatoesblock"), WOODEN_BUTTON(BlockID.WOODEN_BUTTON, "Wooden button", "woodbutton", "woodenbutton"), - HEAD(BlockID.HEAD, "Head", "head", "headmount", "mount"), + HEAD(BlockID.HEAD, "Head", "head", "skull"), ANVIL(BlockID.ANVIL, "Anvil", "anvil", "blacksmith"), TRAPPED_CHEST(BlockID.TRAPPED_CHEST, "Trapped Chest", "trappedchest", "redstonechest"), PRESSURE_PLATE_LIGHT(BlockID.PRESSURE_PLATE_LIGHT, "Weighted Pressure Plate (Light)", "lightpressureplate"), @@ -190,7 +190,7 @@ public enum BlockType { REDSTONE_BLOCK(BlockID.REDSTONE_BLOCK, "Block of Redstone", "redstoneblock", "blockofredstone"), QUARTZ_ORE(BlockID.QUARTZ_ORE, "Nether Quartz Ore", "quartzore", "netherquartzore"), HOPPER(BlockID.HOPPER, "Hopper", "hopper"), - QUARTZ_BLOCK(BlockID.QUARTZ_BLOCK, "Block of Quartz", "quartzblock"), + QUARTZ_BLOCK(BlockID.QUARTZ_BLOCK, "Block of Quartz", "quartzblock", "quartz"), QUARTZ_STAIRS(BlockID.QUARTZ_STAIRS, "Quartz Stairs", "quartzstairs"), ACTIVATOR_RAIL(BlockID.ACTIVATOR_RAIL, "Activator Rail", "activatorrail", "tntrail", "activatortrack"), DROPPER(BlockID.DROPPER, "Dropper", "dropper"); diff --git a/src/main/java/com/sk89q/worldedit/commands/BiomeCommands.java b/src/main/java/com/sk89q/worldedit/commands/BiomeCommands.java index fa5004110..f25c25cd8 100644 --- a/src/main/java/com/sk89q/worldedit/commands/BiomeCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/BiomeCommands.java @@ -153,7 +153,7 @@ public class BiomeCommands { if (args.hasFlag('p')) { Vector2D pos = player.getPosition().toVector2D(); - if (biomeMask != null && (biomeMask.matches2D(editSession, pos) ^ inverted)) { + if (biomeMask == null || (biomeMask.matches2D(editSession, pos) ^ inverted)) { player.getWorld().setBiome(pos, target); player.print("Biome changed to " + target.getName() + " at your current location."); } else { @@ -166,7 +166,7 @@ public class BiomeCommands { if (region instanceof FlatRegion) { for (Vector2D pt : ((FlatRegion) region).asFlatRegion()) { - if (biomeMask != null && (biomeMask.matches2D(editSession, pt) ^ inverted)) { + if (biomeMask == null || (biomeMask.matches2D(editSession, pt) ^ inverted)) { world.setBiome(pt, target); ++affected; } @@ -176,7 +176,7 @@ public class BiomeCommands { for (Vector pt : region) { if (!alreadyVisited.contains((long)pt.getBlockX() << 32 | pt.getBlockZ())) { alreadyVisited.add(((long)pt.getBlockX() << 32 | pt.getBlockZ())); - if (biomeMask != null && (biomeMask.matches(editSession, pt) ^ inverted)) { + if (biomeMask == null || (biomeMask.matches(editSession, pt) ^ inverted)) { world.setBiome(pt.toVector2D(), target); ++affected; }