From 2f3bc59e1b79ce1360a5240cff6eecb6fee96f1a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 20:58:58 +1000 Subject: [PATCH] Fixed //move --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 2 +- .../main/java/com/sk89q/worldedit/command/RegionCommands.java | 3 ++- .../com/sk89q/worldedit/internal/command/WorldEditBinding.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 687cc0be5..6ec84dfcc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -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"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 4bc7d084a..90f7203e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -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); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index 1d7d7d99b..eb06a9455 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -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 {