geforkt von Mirrors/FastAsyncWorldEdit
Allow a pattern for the leave-id of //move
Dieser Commit ist enthalten in:
Ursprung
8d07877463
Commit
d6977aeae4
@ -1222,11 +1222,11 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
* @param dir the direction
|
* @param dir the direction
|
||||||
* @param distance the distance to move
|
* @param distance the distance to move
|
||||||
* @param copyAir true to copy air blocks
|
* @param copyAir true to copy air blocks
|
||||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
* @param replacement the replacement pattern to fill in after moving, or null to use air
|
||||||
* @return number of blocks moved
|
* @return number of blocks moved
|
||||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||||
*/
|
*/
|
||||||
public int moveRegion(Region region, BlockVector3 dir, int distance, boolean copyAir, BlockStateHolder replacement) throws MaxChangedBlocksException {
|
public int moveRegion(Region region, BlockVector3 dir, int distance, boolean copyAir, Pattern replacement) throws MaxChangedBlocksException {
|
||||||
checkNotNull(region);
|
checkNotNull(region);
|
||||||
checkNotNull(dir);
|
checkNotNull(dir);
|
||||||
checkArgument(distance >= 1, "distance >= 1 required");
|
checkArgument(distance >= 1, "distance >= 1 required");
|
||||||
@ -1235,7 +1235,7 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
|
|
||||||
// Remove the original blocks
|
// Remove the original blocks
|
||||||
com.sk89q.worldedit.function.pattern.Pattern pattern = replacement != null ?
|
com.sk89q.worldedit.function.pattern.Pattern pattern = replacement != null ?
|
||||||
new BlockPattern(replacement) :
|
replacement :
|
||||||
new BlockPattern(BlockTypes.AIR.getDefaultState());
|
new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||||
BlockReplace remove = new BlockReplace(this, pattern);
|
BlockReplace remove = new BlockReplace(this, pattern);
|
||||||
|
|
||||||
@ -1266,11 +1266,11 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
* @param dir the direction
|
* @param dir the direction
|
||||||
* @param distance the distance to move
|
* @param distance the distance to move
|
||||||
* @param copyAir true to copy air blocks
|
* @param copyAir true to copy air blocks
|
||||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
* @param replacement the replacement pattern to fill in after moving, or null to use air
|
||||||
* @return number of blocks moved
|
* @return number of blocks moved
|
||||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||||
*/
|
*/
|
||||||
public int moveCuboidRegion(Region region, BlockVector3 dir, int distance, boolean copyAir, BlockStateHolder replacement) throws MaxChangedBlocksException {
|
public int moveCuboidRegion(Region region, BlockVector3 dir, int distance, boolean copyAir, Pattern replacement) throws MaxChangedBlocksException {
|
||||||
return moveRegion(region, dir, distance, copyAir, replacement);
|
return moveRegion(region, dir, distance, copyAir, replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ public class RegionCommands {
|
|||||||
@Selection Region region,
|
@Selection Region region,
|
||||||
@Optional("1") @Range(min = 1) int count,
|
@Optional("1") @Range(min = 1) int count,
|
||||||
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
|
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
|
||||||
@Optional("air") BlockStateHolder replace,
|
@Optional("air") Pattern replace,
|
||||||
@Switch('s') boolean moveSelection) throws WorldEditException {
|
@Switch('s') boolean moveSelection) throws WorldEditException {
|
||||||
|
|
||||||
int affected = editSession.moveRegion(region, direction, count, true, replace);
|
int affected = editSession.moveRegion(region, direction, count, true, replace);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren