small style cleanup

This commit is contained in:
themode 2021-03-19 03:56:25 +01:00
parent 9523892bce
commit 933b2663eb
4 changed files with 19 additions and 17 deletions

View File

@ -84,6 +84,7 @@ public class ArgumentDynamicWord extends Argument<String> {
* @param dynamicRestriction the dynamic restriction, can be null to disable * @param dynamicRestriction the dynamic restriction, can be null to disable
* @return 'this' for chaining * @return 'this' for chaining
*/ */
@NotNull
public ArgumentDynamicWord fromRestrictions(@Nullable StringValidator dynamicRestriction) { public ArgumentDynamicWord fromRestrictions(@Nullable StringValidator dynamicRestriction) {
this.dynamicRestriction = dynamicRestriction; this.dynamicRestriction = dynamicRestriction;
return this; return this;

View File

@ -8,6 +8,7 @@ import org.jetbrains.annotations.NotNull;
* Represents options for {@link Batch}s. * Represents options for {@link Batch}s.
*/ */
public class BatchOption { public class BatchOption {
private boolean fullChunk = false; private boolean fullChunk = false;
private boolean calculateInverse = false; private boolean calculateInverse = false;
private boolean unsafeApply = false; private boolean unsafeApply = false;
@ -49,7 +50,7 @@ public class BatchOption {
* If set, the batch may not be ready, or it may be partially ready which will cause an undefined result. * If set, the batch may not be ready, or it may be partially ready which will cause an undefined result.
* {@link Batch#isReady()} and {@link Batch#awaitReady()} may be used to check if it is ready and block * {@link Batch#isReady()} and {@link Batch#awaitReady()} may be used to check if it is ready and block
* until it is ready. * until it is ready.
* * <p>
* The default implementations of {@link ChunkBatch}, {@link AbsoluteBlockBatch}, and {@link RelativeBlockBatch} * The default implementations of {@link ChunkBatch}, {@link AbsoluteBlockBatch}, and {@link RelativeBlockBatch}
* are always ready unless they are an inverse batch. This is not a safe assumption, and may change in the future. * are always ready unless they are an inverse batch. This is not a safe assumption, and may change in the future.
* <p> * <p>

View File

@ -36,8 +36,8 @@ import java.util.concurrent.CountDownLatch;
* @see Batch * @see Batch
*/ */
public class ChunkBatch implements Batch<ChunkCallback> { public class ChunkBatch implements Batch<ChunkCallback> {
private static final Logger LOGGER = LoggerFactory.getLogger(ChunkBatch.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ChunkBatch.class);
// Need to be synchronized manually // Need to be synchronized manually
// Format: blockIndex/blockStateId/customBlockId (32/16/16 bits) // Format: blockIndex/blockStateId/customBlockId (32/16/16 bits)
@ -178,8 +178,8 @@ public class ChunkBatch implements Batch<ChunkCallback> {
* @return The inverse of this batch, if inverse is enabled in the {@link BatchOption} * @return The inverse of this batch, if inverse is enabled in the {@link BatchOption}
*/ */
protected ChunkBatch apply(@NotNull Instance instance, protected ChunkBatch apply(@NotNull Instance instance,
@NotNull Chunk chunk, @Nullable ChunkCallback callback, @NotNull Chunk chunk, @Nullable ChunkCallback callback,
boolean safeCallback) { boolean safeCallback) {
if (!this.options.isUnsafeApply()) this.awaitReady(); if (!this.options.isUnsafeApply()) this.awaitReady();
final ChunkBatch inverse = this.options.shouldCalculateInverse() ? new ChunkBatch(new LongArrayList(), new Int2ObjectOpenHashMap<>(), options, false) : null; final ChunkBatch inverse = this.options.shouldCalculateInverse() ? new ChunkBatch(new LongArrayList(), new Int2ObjectOpenHashMap<>(), options, false) : null;

View File

@ -264,19 +264,19 @@ public class BlockPosition implements PublicCloneable<BlockPosition> {
*/ */
@NotNull @NotNull
public BlockPosition getRelative(BlockFace face) { public BlockPosition getRelative(BlockFace face) {
switch(face) { switch (face) {
case BOTTOM: case BOTTOM:
return new BlockPosition(getX(), getY() - 1, getZ()); return new BlockPosition(getX(), getY() - 1, getZ());
case TOP: case TOP:
return new BlockPosition(getX(), getY() + 1, getZ()); return new BlockPosition(getX(), getY() + 1, getZ());
case NORTH: case NORTH:
return new BlockPosition(getX(), getY(), getZ() - 1); return new BlockPosition(getX(), getY(), getZ() - 1);
case SOUTH: case SOUTH:
return new BlockPosition(getX(), getY(), getZ() + 1); return new BlockPosition(getX(), getY(), getZ() + 1);
case WEST: case WEST:
return new BlockPosition(getX() - 1, getY(), getZ()); return new BlockPosition(getX() - 1, getY(), getZ());
case EAST: case EAST:
return new BlockPosition(getX() + 1, getY(), getZ()); return new BlockPosition(getX() + 1, getY(), getZ());
} }
return new BlockPosition(getX(), getY(), getZ()); // should never be called return new BlockPosition(getX(), getY(), getZ()); // should never be called
} }