Permalink
Browse files

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.
  • Loading branch information...
wizjany committed Feb 4, 2019
1 parent f3ec5bb commit dddf2b963a8a959dba11b985648118ecb5f25bfa
@@ -205,7 +205,7 @@ public void longrangebuildtool(Player player, LocalSession session, Pattern seco
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 + ".");
}
}
@@ -61,7 +61,7 @@ public boolean actSecondary(Platform server, LocalConfiguration config, Player p
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 boolean actPrimary(Platform server, LocalConfiguration config, Player pla
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) {

0 comments on commit dddf2b9

Please sign in to comment.