Minor changes to match upstream more closely

This commit is contained in:
MattBDev
2019-10-23 14:29:37 -04:00
parent c050132737
commit 1b28dcda40
14 changed files with 82 additions and 172 deletions

View File

@ -476,10 +476,10 @@ public class RegionCommands {
boolean moveSelection,
@Switch(name = 'a', desc = "Ignore air blocks")
boolean ignoreAirBlocks,
@Switch(name = 'b', desc = "Copy Biomes")
boolean copyBiomes,
@Switch(name = 'e', desc = "Ignore entities")
boolean skipEntities,
@Switch(name = 'b', desc = "Also copy biomes")
boolean copyBiomes,
InjectedValueAccess context) throws WorldEditException {
checkCommandArgument(count >= 1, "Count must be >= 1");
actor.checkConfirmationRegion(() -> {
@ -534,12 +534,12 @@ public class RegionCommands {
BlockVector3 direction,
@Switch(name = 's', desc = "Shift the selection to the last stacked copy")
boolean moveSelection,
@Switch(name = 'b', desc = "Copy Biomes")
boolean copyBiomes,
@Switch(name = 'e', desc = "Skip entities")
boolean skipEntities,
@Switch(name = 'a', desc = "Ignore air blocks")
boolean ignoreAirBlocks,
@Switch(name = 'e', desc = "Skip entities")
boolean skipEntities,
@Switch(name = 'b', desc = "Also copy biomes")
boolean copyBiomes,
@ArgFlag(name = 'm', desc = "Source mask")
Mask sourceMask,
InjectedValueAccess context) throws WorldEditException {

View File

@ -62,12 +62,12 @@ public class BlockDataCyler implements DoubleActionBlockTool {
if (!config.allowedDataCycleBlocks.isEmpty()
&& !player.hasPermission("worldedit.override.data-cycler")
&& !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) {
BBC.BLOCK_CYCLER_NO_PERM.send(player);
player.printError(BBC.BLOCK_CYCLER_NO_PERM.s());
return true;
}
if (block.getStates().keySet().isEmpty()) {
BBC.BLOCK_CYCLER_CANNOT_CYCLE.send(player);
player.printError(BBC.BLOCK_CYCLER_CANNOT_CYCLE.s());
} else {
Property<?> currentProperty = selectedProperties.get(player.getUniqueId());
@ -91,7 +91,7 @@ public class BlockDataCyler implements DoubleActionBlockTool {
editSession.setBlock(blockPoint, newBlock);
player.print("Value of " + currentProperty.getName() + " is now " + currentProperty.getValues().get(index));
} catch (MaxChangedBlocksException e) {
BBC.BLOCK_CYCLER_LIMIT.send(player);
player.printError(BBC.BLOCK_CYCLER_LIMIT.s());
} finally {
session.remember(editSession);
}

View File

@ -283,6 +283,7 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
*
* @return the filter
*/
//TODO A better description is needed here to explain what makes a source-mask different from a regular mask.
public Mask getSourceMask() {
return getContext().getSourceMask();
}

View File

@ -74,15 +74,14 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool {
private Location getTarget(Player player) {
Location target;
Mask mask = getTraceMask();
int range = getRange();
if (range < MAX_RANGE) {
target = player.getBlockTrace(range, true, mask);
if (this.range < MAX_RANGE) {
target = player.getBlockTrace(getRange(), true, mask);
} else {
target = player.getBlockTrace(MAX_RANGE, false, mask);
}
if (target == null) {
BBC.NO_BLOCK.send(player);
player.printError(BBC.NO_BLOCK.s());
return null;
}

View File

@ -74,7 +74,7 @@ public class FloatingTreeRemover implements BlockTool {
final BlockState state = world.getBlock(clicked.toVector().toBlockPoint());
if (!isTreeBlock(state.getBlockType())) {
BBC.TOOL_DELTREE_ERROR.send(player);
player.printError(BBC.TOOL_DELTREE_ERROR.s());
return true;
}

View File

@ -100,7 +100,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
target = player.getBlockTrace(MAX_RANGE, false, mask);
}
if (target == null) {
BBC.NO_BLOCK.send(player);
player.printError(BBC.NO_BLOCK.s());
return null;
}

View File

@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
public class GravityBrush implements Brush {
@ -43,7 +43,7 @@ public class GravityBrush implements Brush {
for (double z = position.getZ() + size; z > position.getZ() - size; --z) {
double freeSpot = startCheckY;
for (double y = startCheckY; y <= endY; y++) {
BlockStateHolder block = editSession.getBlock((int)x, (int)y, (int)z);
BlockState block = editSession.getBlock((int)x, (int)y, (int)z);
if (!block.getBlockType().getMaterial().isAir()) {
if (y != freeSpot) {
editSession.setBlock((int)x, (int)y, (int)z, BlockTypes.AIR.getDefaultState());