Fixed //stack -s only shifting by 1 block, regardless of the selection size.

This commit is contained in:
TomyLobo 2011-12-05 23:21:51 +01:00
parent a5a761a126
commit 258bdc11b0

View File

@ -290,9 +290,12 @@ public class RegionCommands {
if (args.hasFlag('s')) { if (args.hasFlag('s')) {
try { try {
Region region = session.getSelection(player.getWorld()); final Region region = session.getSelection(player.getWorld());
region.expand(dir.multiply(count)); final Vector size = region.getMaximumPoint().subtract(region.getMinimumPoint());
region.contract(dir.multiply(count));
final Vector shiftVector = dir.multiply(count * Math.abs(size.dot(size)));
region.expand(shiftVector);
region.contract(shiftVector);
session.getRegionSelector().learnChanges(); session.getRegionSelector().learnChanges();
session.getRegionSelector().explainRegionAdjust(player, session); session.getRegionSelector().explainRegionAdjust(player, session);