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
* @return 'this' for chaining
*/
@NotNull
public ArgumentDynamicWord fromRestrictions(@Nullable StringValidator dynamicRestriction) {
this.dynamicRestriction = dynamicRestriction;
return this;

View File

@ -8,6 +8,7 @@ import org.jetbrains.annotations.NotNull;
* Represents options for {@link Batch}s.
*/
public class BatchOption {
private boolean fullChunk = false;
private boolean calculateInverse = 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.
* {@link Batch#isReady()} and {@link Batch#awaitReady()} may be used to check if it is ready and block
* until it is ready.
*
* <p>
* 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.
* <p>

View File

@ -36,8 +36,8 @@ import java.util.concurrent.CountDownLatch;
* @see Batch
*/
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
// 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}
*/
protected ChunkBatch apply(@NotNull Instance instance,
@NotNull Chunk chunk, @Nullable ChunkCallback callback,
boolean safeCallback) {
@NotNull Chunk chunk, @Nullable ChunkCallback callback,
boolean safeCallback) {
if (!this.options.isUnsafeApply()) this.awaitReady();
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
public BlockPosition getRelative(BlockFace face) {
switch(face) {
case BOTTOM:
return new BlockPosition(getX(), getY() - 1, getZ());
case TOP:
return new BlockPosition(getX(), getY() + 1, getZ());
case NORTH:
return new BlockPosition(getX(), getY(), getZ() - 1);
case SOUTH:
return new BlockPosition(getX(), getY(), getZ() + 1);
case WEST:
return new BlockPosition(getX() - 1, getY(), getZ());
case EAST:
return new BlockPosition(getX() + 1, getY(), getZ());
switch (face) {
case BOTTOM:
return new BlockPosition(getX(), getY() - 1, getZ());
case TOP:
return new BlockPosition(getX(), getY() + 1, getZ());
case NORTH:
return new BlockPosition(getX(), getY(), getZ() - 1);
case SOUTH:
return new BlockPosition(getX(), getY(), getZ() + 1);
case WEST:
return new BlockPosition(getX() - 1, getY(), getZ());
case EAST:
return new BlockPosition(getX() + 1, getY(), getZ());
}
return new BlockPosition(getX(), getY(), getZ()); // should never be called
}