mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +00:00
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:
@ -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);
|
||||
|
@ -266,6 +266,7 @@ public class SelectionCommands {
|
||||
max = 3
|
||||
)
|
||||
@CommandPermissions("worldedit.selection.expand")
|
||||
@SuppressWarnings("deprecation")
|
||||
public void expand(CommandContext args, LocalSession session, LocalPlayer player,
|
||||
EditSession editSession) throws WorldEditException {
|
||||
|
||||
@ -278,8 +279,9 @@ public class SelectionCommands {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
try {
|
||||
int oldSize = region.getArea();
|
||||
region.expand(new Vector(0, (player.getWorld().getMaxY() + 1), 0));
|
||||
region.expand(new Vector(0, -(player.getWorld().getMaxY() + 1), 0));
|
||||
region.expand(
|
||||
new Vector(0, (player.getWorld().getMaxY() + 1), 0),
|
||||
new Vector(0, -(player.getWorld().getMaxY() + 1), 0));
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
int newSize = region.getArea();
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
@ -341,6 +343,7 @@ public class SelectionCommands {
|
||||
max = 3
|
||||
)
|
||||
@CommandPermissions("worldedit.selection.contract")
|
||||
@SuppressWarnings("deprecation")
|
||||
public void contract(CommandContext args, LocalSession session, LocalPlayer player,
|
||||
EditSession editSession) throws WorldEditException {
|
||||
|
||||
|
Reference in New Issue
Block a user