Deprecate expand/contract(Vector) in favor of varargs versions

This keeps things simpler by not dealing with redundant implementations
for single change and multiple changes.
This also let regions handle related changes in a more efficient way
(for example recalculates region components only when needed).
This commit is contained in:
aumgn
2012-03-14 11:21:41 +01:00
committed by TomyLobo
parent 1359a7fada
commit 8506bb437e
6 changed files with 111 additions and 96 deletions

View File

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