From 1aa08104b590274b3b9b8740cb044f0642cb6cd8 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Tue, 21 Jun 2011 12:44:12 -0400 Subject: [PATCH] Made a few commands obey //toggleplace --- src/main/java/com/sk89q/worldedit/blocks/BlockType.java | 3 ++- .../com/sk89q/worldedit/commands/UtilityCommands.java | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 491f0d713..68e5a1737 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -532,7 +532,8 @@ public enum BlockType { * @return */ public static boolean canTransferRedstone(int id) { - return id == 75 // Redstone torch (off) + return id == 27 // Powered rail + || id == 75 // Redstone torch (off) || id == 76 // Redstone torch (on) || id == 55 // Redstone wire || id == 93 // Diode (off) diff --git a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java index 6d9ce9f43..2fccb6fc7 100644 --- a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java @@ -236,8 +236,9 @@ public class UtilityCommands { to = we.getBlock(player, args.getString(2)); } - Vector min = player.getBlockIn().subtract(size, size, size); - Vector max = player.getBlockIn().add(size, size, size); + Vector base = session.getPlacementPosition(player); + Vector min = base.subtract(size, size, size); + Vector max = base.add(size, size, size); Region region = new CuboidRegion(min, max); int affected = editSession.replaceBlocks(region, from, to); @@ -258,7 +259,7 @@ public class UtilityCommands { int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10; - int affected = editSession.simulateSnow(player.getBlockIn(), size); + int affected = editSession.simulateSnow(session.getPlacementPosition(player), size); player.print(affected + " surfaces covered. Let it snow~"); } @@ -276,7 +277,7 @@ public class UtilityCommands { int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10; - int affected = editSession.thaw(player.getBlockIn(), size); + int affected = editSession.thaw(session.getPlacementPosition(player), size); player.print(affected + " surfaces thawed."); }