Convert tabs to whitespace.

This commit is contained in:
MattBDev
2019-07-22 16:42:40 -04:00
parent 4d8cf04be1
commit 46f5b12b36
75 changed files with 513 additions and 546 deletions

View File

@ -3052,8 +3052,8 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
final FaweRegionExtent fe = this.getRegionExtent();
final boolean cuboid = region instanceof CuboidRegion;
if (fe != null && cuboid) {
BlockVector3 max = region.getMaximumPoint();
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
BlockVector3 min = region.getMinimumPoint();
if (!fe.contains(max.getBlockX(), max.getBlockY(), max.getBlockZ()) && !fe.contains(min.getBlockX(), min.getBlockY(), min.getBlockZ())) {
throw FaweException.OUTSIDE_REGION;
}
@ -3190,24 +3190,24 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
world.setWeather(weatherType, duration);
}
@Override
public void dropItem(Vector3 position, BaseItemStack item) {
world.dropItem(position, item);
}
@Override
public void dropItem(Vector3 position, BaseItemStack item) {
world.dropItem(position, item);
}
@Override
public boolean playEffect(Vector3 position, int type, int data) {
return world.playEffect(position, type, data);
}
@Override
public boolean playEffect(Vector3 position, int type, int data) {
return world.playEffect(position, type, data);
}
@Override
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
return world.notifyAndLightBlock(position, previousType);
}
@Override
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
return world.notifyAndLightBlock(position, previousType);
}
@Override
public BlockVector3 getSpawnPosition() {
return world.getSpawnPosition();
}
@Override
public BlockVector3 getSpawnPosition() {
return world.getSpawnPosition();
}
}

View File

@ -323,7 +323,7 @@ public class RegionCommands extends MethodCommands {
int y = 0;
int affected = 0;
while (iter.hasNext()) {
BlockVector2 pos = iter.next();
BlockVector2 pos = iter.next();
int x = pos.getBlockX();
int z = pos.getBlockZ();
y = editSession.getNearestSurfaceTerrainBlock(x, z, y, 0, maxY);
@ -405,8 +405,8 @@ public class RegionCommands extends MethodCommands {
@Arg(desc = "The mask of blocks to use as the height map", def = "")
Mask mask,
@Switch(name='s', desc = "TODO") boolean snow, InjectedValueAccess context) throws WorldEditException {
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
FaweLimit limit = FawePlayer.wrap(player).getLimit();
if (volume >= limit.MAX_CHECKS) {

View File

@ -183,9 +183,9 @@ public class DefaultMaskParser extends FaweParser<Mask> {
}
}
} else {
List<String> args = entry.getValue();
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
try {
List<String> args = entry.getValue();
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
try {
mask = (Mask) dispatcher.call(command + cmdArgs, locals, new String[0]);
} catch (SuggestInputParseException rethrow) {
throw rethrow;
@ -239,6 +239,6 @@ public class DefaultMaskParser extends FaweParser<Mask> {
} else {
return null;
}
}
}

View File

@ -26,8 +26,7 @@ public class AnnotatedBindings extends Bindings {
* @param modifiers the list of modifiers to scan
* @throws InputParseException on a validation error
*/
private static String validate(String string, Annotation... modifiers)
{
private static String validate(String string, Annotation... modifiers) {
if (string != null) {
for (Annotation modifier : modifiers) {
if (modifier instanceof Validate) {

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.extent;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.object.HistoryExtent;
import com.boydti.fawe.object.changeset.FaweChangeSet;
@ -35,11 +37,8 @@ import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* A base class for {@link Extent}s that merely passes extents onto another.
*/
@ -79,7 +78,7 @@ public class AbstractDelegateExtent implements Extent, LightingExtent {
if (!(extent instanceof ForgetfulExtentBuffer)) { // placeholder
extent.disableQueue();
}
} catch (FaweException disableQueue) {}
} catch (FaweException ignored) {}
if (extent instanceof AbstractDelegateExtent) {
Extent next = ((AbstractDelegateExtent) extent).getExtent();
new ExtentTraverser(this).setNext(next);

View File

@ -19,14 +19,13 @@
package com.sk89q.worldedit.extent.clipboard;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
import com.boydti.fawe.object.clipboard.FaweClipboard;
import com.boydti.fawe.object.clipboard.FaweClipboard.ClipboardEntity;
import com.boydti.fawe.object.clipboard.MemoryOptimizedClipboard;
import com.boydti.fawe.object.extent.LightingExtent;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity;
@ -41,13 +40,12 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import javax.annotation.Nullable;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import javax.annotation.Nullable;
/**
* Stores block data as a multi-dimensional array of {@link BlockState}s and
@ -55,7 +53,7 @@ import java.util.UUID;
*/
public class BlockArrayClipboard implements Clipboard, Closeable {
private Region region;
private Region region;
private BlockVector3 origin;
public FaweClipboard IMP;
private BlockVector3 size;
@ -204,7 +202,7 @@ public class BlockArrayClipboard implements Clipboard, Closeable {
int z = position.getBlockZ() - mz;
return IMP.getBlock(x, y, z);
}
return BlockTypes.AIR.getDefaultState().toBaseBlock();
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}
@Override

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.extent.clipboard.io;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.clipboard.LazyClipboardHolder;
@ -26,8 +28,6 @@ import com.boydti.fawe.object.clipboard.MultiClipboardHolder;
import com.boydti.fawe.object.clipboard.URIClipboardHolder;
import com.boydti.fawe.object.io.FastByteArrayOutputStream;
import com.boydti.fawe.util.MainUtil;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
@ -36,8 +36,6 @@ import com.google.common.io.Files;
import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Actor;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -59,6 +57,7 @@ import java.util.Map.Entry;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.annotation.Nullable;
public class ClipboardFormats {
@ -130,15 +129,15 @@ public class ClipboardFormats {
*/
@Nullable
public static ClipboardFormat findByExtension(String extension) {
checkNotNull(extension);
checkNotNull(extension);
Collection<Entry<String, ClipboardFormat>> entries = getFileExtensionMap().entries();
for(Map.Entry<String, ClipboardFormat> entry : entries) {
if(entry.getKey().equalsIgnoreCase(extension)) {
return entry.getValue();
}
}
return null;
Collection<Entry<String, ClipboardFormat>> entries = getFileExtensionMap().entries();
for(Map.Entry<String, ClipboardFormat> entry : entries) {
if(entry.getKey().equalsIgnoreCase(extension)) {
return entry.getValue();
}
}
return null;
}

View File

@ -50,7 +50,7 @@ public class BlockReplace implements RegionFunction {
@Override
public boolean apply(BlockVector3 position) throws WorldEditException {
return pattern.apply(extent, position, position);
return pattern.apply(extent, position, position);
}
}

View File

@ -9,9 +9,7 @@ import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import java.util.List;
import java.util.Vector;
public class BackwardsExtentBlockCopy implements Operation {
private final Region region;
@ -34,7 +32,7 @@ public class BackwardsExtentBlockCopy implements Operation {
CuboidRegion destRegion = transform(this.transform, this.region);
Transform inverse = this.transform.inverse();
for (BlockVector3 pt : destRegion) {
BlockVector3 copyFrom = transform(inverse, pt);
BlockVector3 copyFrom = transform(inverse, pt);
if (region.contains(copyFrom)) {
function.apply(pt);
}
@ -43,14 +41,14 @@ public class BackwardsExtentBlockCopy implements Operation {
}
private CuboidRegion transform(Transform transform, Region region) {
BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
BlockVector3 pos1 = region.getMinimumPoint();
BlockVector3 pos2 = region.getMaximumPoint();
BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
BlockVector3 pos1 = region.getMinimumPoint();
BlockVector3 pos2 = region.getMaximumPoint();
for (int x : new int[] { pos1.getBlockX(), pos2.getBlockX() }) {
for (int y : new int[] { pos1.getBlockY(), pos2.getBlockY() }) {
for (int z : new int[] { pos1.getBlockZ(), pos2.getBlockZ() }) {
BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z));
BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z));
min = min.getMinimum(pt);
max = max.getMaximum(pt);
}

View File

@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.visitor;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.example.MappedIQueueExtent;
import com.boydti.fawe.object.collection.BlockVectorSet;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.function.RegionFunction;
@ -37,8 +36,6 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Performs a breadth-first search starting from points added with
* {@link #visit(BlockVector3)}. The search continues
@ -67,7 +64,7 @@ public abstract class BreadthFirstSearch implements Operation {
for (int y = -1; y <= 1; y++) {
for (int z = -1; z <= 1; z++) {
if (x != 0 || y != 0 || z != 0) {
BlockVector3 pos = BlockVector3.at(x, y, z);
BlockVector3 pos = BlockVector3.at(x, y, z);
if (!list.contains(pos)) {
list.add(pos);
}

View File

@ -89,7 +89,7 @@ public class HeightMap {
invalid = new boolean[data.length];
if (layers) {
BlockVector3 min = region.getMinimumPoint();
BlockVector3 min = region.getMinimumPoint();
int bx = min.getBlockX();
int bz = min.getBlockZ();
Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion();

View File

@ -52,21 +52,21 @@ public final class IncendoPaste implements Paster{
this.pasteApplication = pasteApplication;
}
@Override
public Callable<URL> paste(String content) {
return new PasteTask(content);
}
@Override
public Callable<URL> paste(String content) {
return new PasteTask(content);
}
private final class PasteTask implements Callable<URL>{
private final class PasteTask implements Callable<URL>{
private PasteTask(String content) {}
private PasteTask(String content) {}
@Override
public URL call() throws Exception {
return new URL(debugPaste());
}
@Override
public URL call() throws Exception {
return new URL(debugPaste());
}
}
}
/**
* Get an immutable collection containing all the files that have been added to this paster

View File

@ -20,22 +20,21 @@
package com.sk89q.worldedit.world.block;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.function.mask.ABlockMask;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.registry.state.PropertyKey;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Nullable;
/**
* Represents a "snapshot" of a block with NBT Data.
@ -71,7 +70,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
* @param blockState The blockstate
*/
public BaseBlock(BlockState blockState) {
this.blockState = blockState;
this.blockState = blockState;
nbtData = null;
}
@ -244,31 +243,31 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
return this;
}
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
set.setFullBlock(extent, this);
return true;
}
}
@Override
public BaseBlock withPropertyId(int propertyId) {
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
}
@Override
public BaseBlock withPropertyId(int propertyId) {
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
}
@Override
public int getInternalBlockTypeId() {
return toImmutableState().getInternalBlockTypeId();
}
@Override
public int getInternalBlockTypeId() {
return toImmutableState().getInternalBlockTypeId();
}
@Override
public int getInternalPropertiesId() {
return toImmutableState().getInternalPropertiesId();
}
@Override
public int getInternalPropertiesId() {
return toImmutableState().getInternalPropertiesId();
}
@Override
public <V> BaseBlock with(PropertyKey property, V value) {
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
}
@Override
public <V> BaseBlock with(PropertyKey property, V value) {
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
}
@Override
public BaseBlock toBaseBlock(CompoundTag compoundTag) {

View File

@ -338,13 +338,13 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
return new BaseBlock(this, compoundTag);
}
@Override
public int getInternalId() {
return internalId;
}
@Override
public int getInternalId() {
return internalId;
}
@Override
public BlockMaterial getMaterial() {
@Override
public BlockMaterial getMaterial() {
if (this.material == null) {
if (blockType == BlockTypes.__RESERVED__) {
return this.material = blockType.getMaterial();
@ -352,7 +352,7 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
}
return material;
}
}
@Override
public final int getOrdinal() {

View File

@ -19,7 +19,8 @@
package com.sk89q.worldedit.world.block;
import com.google.common.collect.ImmutableList;
import static com.google.common.base.Preconditions.checkArgument;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extension.platform.Capability;
@ -35,19 +36,16 @@ import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static com.google.common.base.Preconditions.checkArgument;
import javax.annotation.Nullable;
public class BlockType implements FawePattern, Keyed {
private final String id;
private final String id;
private final BlockTypes.Settings settings;
private boolean initItemType;
@ -61,7 +59,7 @@ public class BlockType implements FawePattern, Keyed {
@Deprecated
public int getMaxStateId() {
return settings.permutations;
return settings.permutations;
}
/**
@ -248,7 +246,7 @@ public class BlockType implements FawePattern, Keyed {
* @return The material
*/
public BlockMaterial getMaterial() {
return this.settings.blockMaterial;
return this.settings.blockMaterial;
}
/**
@ -272,7 +270,7 @@ public class BlockType implements FawePattern, Keyed {
* @return internal id
*/
public int getInternalId() {
return this.settings.internalId;
return this.settings.internalId;
}
@Override

View File

@ -107,14 +107,14 @@ public class ItemType implements RegistryItem, Keyed {
}
public void setBlockType(BlockType blockType) {
this.blockType = blockType;
this.blockType = blockType;
}
public BaseItem getDefaultState() {
if (defaultState == null) {
this.defaultState = new BaseItemStack(this);
}
return this.defaultState;
return this.defaultState;
}
@Override

View File

@ -245,26 +245,26 @@ public final class LegacyMapper {
}
public BaseBlock getBaseBlockFromPlotBlock(PlotBlock plotBlock) {
if(plotBlock instanceof StringPlotBlock) {
try {
return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else if(plotBlock instanceof LegacyPlotBlock) {
try {
return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
return null;
}
if(plotBlock instanceof StringPlotBlock) {
try {
return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else if(plotBlock instanceof LegacyPlotBlock) {
try {
return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
return null;
}
}
public static LegacyMapper getInstance() {