Skip to content

Commit

Permalink
Fix long-range build tool.
Browse files Browse the repository at this point in the history
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 dddf2b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ".");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit dddf2b9

Please sign in to comment.