From dddf2b963a8a959dba11b985648118ecb5f25bfa Mon Sep 17 00:00:00 2001 From: wizjany Date: Sun, 3 Feb 2019 19:27:30 -0500 Subject: [PATCH] Fix long-range build tool. Blocks were always placed around 0,0,0 since the trace direction was being used as a position. Also the message was backwards. --- .../main/java/com/sk89q/worldedit/command/ToolCommands.java | 4 ++-- .../com/sk89q/worldedit/command/tool/LongRangeBuildTool.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 0391e0bf2..fdf5337aa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -205,7 +205,7 @@ public class ToolCommands { if (secondary instanceof BlockPattern) { secondaryName = ((BlockPattern) secondary).getBlock().getBlockType().getName(); } - player.print("Left-click set to " + secondaryName + "; right-click set to " - + primaryName + "."); + player.print("Left-click set to " + primaryName + "; right-click set to " + + secondaryName + "."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index f374746ac..155beb4e8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -61,7 +61,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (applied.getBlockType().getMaterial().isAir()) { eS.setBlock(blockPoint, secondary); } else { - eS.setBlock(pos.getDirection().toBlockPoint(), secondary); + eS.setBlock(pos.toVector().subtract(pos.getDirection()).toBlockPoint(), secondary); } return true; } catch (MaxChangedBlocksException e) { @@ -82,7 +82,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (applied.getBlockType().getMaterial().isAir()) { eS.setBlock(blockPoint, primary); } else { - eS.setBlock(pos.getDirection().toBlockPoint(), primary); + eS.setBlock(pos.toVector().subtract(pos.getDirection()).toBlockPoint(), primary); } return true; } catch (MaxChangedBlocksException e) {