Fixed //move

This commit is contained in:
Matthew Miller 2018-08-03 20:58:58 +10:00
parent 7773ef6f9a
commit 2f3bc59e1b
3 changed files with 5 additions and 3 deletions

View File

@ -1046,7 +1046,7 @@ public class EditSession implements Extent {
* @return number of blocks moved
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int moveRegion(Region region, Vector dir, int distance, boolean copyAir, BaseBlock replacement) throws MaxChangedBlocksException {
public int moveRegion(Region region, Vector dir, int distance, boolean copyAir, BlockStateHolder replacement) throws MaxChangedBlocksException {
checkNotNull(region);
checkNotNull(dir);
checkArgument(distance >= 1, "distance >= 1 required");

View File

@ -62,6 +62,7 @@ import com.sk89q.worldedit.util.command.binding.Range;
import com.sk89q.worldedit.util.command.binding.Switch;
import com.sk89q.worldedit.util.command.binding.Text;
import com.sk89q.worldedit.util.command.parametric.Optional;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import java.util.ArrayList;
import java.util.List;
@ -275,7 +276,7 @@ public class RegionCommands {
@Selection Region region,
@Optional("1") @Range(min = 1) int count,
@Optional(Direction.AIM) @Direction Vector direction,
@Optional("air") BaseBlock replace,
@Optional("air") BlockStateHolder replace,
@Switch('s') boolean moveSelection) throws WorldEditException {
int affected = editSession.moveRegion(region, direction, count, true, replace);

View File

@ -49,6 +49,7 @@ import com.sk89q.worldedit.util.command.parametric.ParameterException;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BaseBiome;
import com.sk89q.worldedit.world.biome.Biomes;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.registry.BiomeRegistry;
@ -168,7 +169,7 @@ public class WorldEditBinding extends BindingHelper {
* @throws ParameterException on error
* @throws WorldEditException on error
*/
@BindingMatch(type = BaseBlock.class,
@BindingMatch(type = {BaseBlock.class, BlockState.class, BlockStateHolder.class},
behavior = BindingBehavior.CONSUMES,
consumedCount = 1)
public BlockStateHolder getBaseBlock(ArgumentStack context) throws ParameterException, WorldEditException {