Skip to content

Commit

Permalink
Why did IDEA indent so much?
Browse files Browse the repository at this point in the history
  • Loading branch information
Stickia committed Feb 24, 2025
1 parent 841e644 commit bc64650
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class CircleExecutionState {


protected CircleExecutionState(BlockPos impetusPos, Direction impetusDir, Set<BlockPos> knownPositions,
HashSet<BlockPos> reachedPositions, BlockPos currentPos, Direction enteredFrom,
CastingImage currentImage, @Nullable UUID caster, @Nullable FrozenPigment casterPigment, Integer reachedSlate) {
HashSet<BlockPos> reachedPositions, BlockPos currentPos, Direction enteredFrom,
CastingImage currentImage, @Nullable UUID caster, @Nullable FrozenPigment casterPigment, Integer reachedSlate) {
this.impetusPos = impetusPos;
this.impetusDir = impetusDir;
this.knownPositions = knownPositions;
Expand Down Expand Up @@ -86,7 +86,7 @@ protected CircleExecutionState(BlockPos impetusPos, Direction impetusDir, Set<Bl

// Return OK if it succeeded; returns Err if it didn't close and the location
public static Result<CircleExecutionState, @Nullable BlockPos> createNew(BlockEntityAbstractImpetus impetus,
@Nullable ServerPlayer caster) {
@Nullable ServerPlayer caster) {
var level = (ServerLevel) impetus.getLevel();

if (level == null)
Expand Down Expand Up @@ -145,8 +145,8 @@ protected CircleExecutionState(BlockPos impetusPos, Direction impetusDir, Set<Bl
casterUUID = caster.getUUID();
}
return new Result.Ok<>(
new CircleExecutionState(impetus.getBlockPos(), impetus.getStartDirection(), knownPositions,
reachedPositions, start, impetus.getStartDirection(), new CastingImage(), casterUUID, colorizer, 0));
new CircleExecutionState(impetus.getBlockPos(), impetus.getStartDirection(), knownPositions,
reachedPositions, start, impetus.getStartDirection(), new CastingImage(), casterUUID, colorizer, 0));
}

public CompoundTag save() {
Expand Down Expand Up @@ -213,7 +213,7 @@ public static CircleExecutionState load(CompoundTag nbt, ServerLevel world) {
}

return new CircleExecutionState(startPos, startDir, knownPositions, reachedPositions, currentPos,
enteredFrom, image, caster, pigment, reachedNumber);
enteredFrom, image, caster, pigment, reachedNumber);
}

/**
Expand All @@ -233,7 +233,7 @@ public boolean tick(BlockEntityAbstractImpetus impetus) {
if (!(executorBlockState.getBlock() instanceof ICircleComponent executor)) {
// TODO: notification of the error?
ICircleComponent.sfx(this.currentPos, executorBlockState, world,
Objects.requireNonNull(env.getImpetus()), false);
Objects.requireNonNull(env.getImpetus()), false);
return false;
}

Expand All @@ -244,7 +244,7 @@ public boolean tick(BlockEntityAbstractImpetus impetus) {
// Do the execution!
boolean halt = false;
var ctrl = executor.acceptControlFlow(this.currentImage, env, this.enteredFrom, this.currentPos,
executorBlockState, world);
executorBlockState, world);

if (env.getImpetus() == null)
return false; //the impetus got removed during the cast and no longer exists in the world. stop casting
Expand All @@ -258,13 +258,13 @@ public boolean tick(BlockEntityAbstractImpetus impetus) {
for (var exit : cont.exits) {
var there = world.getBlockState(exit.getFirst());
if (there.getBlock() instanceof ICircleComponent cc
&& cc.canEnterFromDirection(exit.getSecond(), exit.getFirst(), there, world)) {
&& cc.canEnterFromDirection(exit.getSecond(), exit.getFirst(), there, world)) {
if (found != null) {
// oh no!
impetus.postDisplay(
Component.translatable("hexcasting.tooltip.circle.many_exits",
Component.literal(this.currentPos.toShortString()).withStyle(ChatFormatting.RED)),
new ItemStack(Items.COMPASS));
Component.translatable("hexcasting.tooltip.circle.many_exits",
Component.literal(this.currentPos.toShortString()).withStyle(ChatFormatting.RED)),
new ItemStack(Items.COMPASS));
ICircleComponent.sfx(this.currentPos, executorBlockState, world,
Objects.requireNonNull(env.getImpetus()), false);
halt = true;
Expand All @@ -278,13 +278,13 @@ public boolean tick(BlockEntityAbstractImpetus impetus) {
if (found == null) {
// will never enter here if there were too many because found will have been set
ICircleComponent.sfx(this.currentPos, executorBlockState, world,
Objects.requireNonNull(env.getImpetus()), false);
Objects.requireNonNull(env.getImpetus()), false);
impetus.postNoExits(this.currentPos);
halt = true;
} else {
// A single valid exit position has been found.
ICircleComponent.sfx(this.currentPos, executorBlockState, world,
Objects.requireNonNull(env.getImpetus()), true);
Objects.requireNonNull(env.getImpetus()), true);
currentPos = found.getFirst();
enteredFrom = found.getSecond();
currentImage = cont.update.withOverriddenUsedOps(0); // reset ops used after each slate finishes executing
Expand Down

0 comments on commit bc64650

Please sign in to comment.