More code quality fixes

This commit is contained in:
MattBDev
2020-01-22 16:56:24 -05:00
parent 88359f0215
commit 2d6957ce1c
115 changed files with 686 additions and 1688 deletions

View File

@ -54,6 +54,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public class BlockArrayClipboard extends DelegateClipboard implements Clipboard, Closeable {
@NotNull
private Region region;
private BlockVector3 offset;
@ -85,6 +86,7 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
setRegion(region);
}
@NotNull
@Override
public Region getRegion() {
return region;

View File

@ -77,12 +77,17 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
static Clipboard create(BlockVector3 size, UUID uuid) {
if (Settings.IMP.CLIPBOARD.USE_DISK) {
return new DiskOptimizedClipboard(size, uuid);
try {
return new DiskOptimizedClipboard(size, uuid);
} catch (IOException e) {
e.printStackTrace();
}
} else if (Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL == 0) {
return new CPUOptimizedClipboard(size);
} else {
return new MemoryOptimizedClipboard(size);
}
return null;
}
/**
@ -116,11 +121,10 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
void setOrigin(BlockVector3 origin);
/**
* Returns true if the clipboard has biome data. This can be checked since {@link
* Extent#getBiome(BlockVector2)} strongly suggests returning {@link
* com.sk89q.worldedit.world.biome.BiomeTypes#OCEAN} instead of {@code null} if biomes aren't
* present. However, it might not be desired to set areas to ocean if the clipboard is
* defaulting to ocean, instead of having biomes explicitly set.
* Returns true if the clipboard has biome data. This can be checked since {@link Extent#getBiome(BlockVector2)}
* strongly suggests returning {@link com.sk89q.worldedit.world.biome.BiomeTypes#OCEAN} instead of {@code null}
* if biomes aren't present. However, it might not be desired to set areas to ocean if the clipboard is defaulting
* to ocean, instead of having biomes explicitly set.
*
* @return true if the clipboard has biome data set
*/