Skip to content

Commit 714e7af

Browse files
committed
More minor formatting changes.
1 parent 0379128 commit 714e7af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/baritone/pathing/movement/MovementHelper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import net.minecraft.world.level.pathfinder.PathComputationType;
5050
import net.minecraft.world.phys.BlockHitResult;
5151
import net.minecraft.world.phys.HitResult;
52-
import net.minecraft.world.phys.Vec2;
5352
import net.minecraft.world.phys.Vec3;
5453

5554
import java.util.*;

src/main/java/baritone/pathing/movement/MovementOption.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.stream.Stream;
2424

2525
public record MovementOption(Input input1, Input input2, float motionX, float motionZ) {
26+
private static final float SPRINT_MULTIPLIER = 1.3f;
2627

2728
public MovementOption(Input input1, float motionX, float motionZ) {
2829
this(input1, null, motionX, motionZ);
@@ -43,12 +44,12 @@ public float distanceToSq(float otherX, float otherZ) {
4344

4445
public static Stream<MovementOption> getOptions(float motionX, float motionZ, boolean canSprint) {
4546
return Stream.of(
46-
new MovementOption(Input.MOVE_FORWARD, canSprint ? motionX * 1.3f : motionX, canSprint ? motionZ * 1.3f : motionZ),
47+
new MovementOption(Input.MOVE_FORWARD, canSprint ? motionX * SPRINT_MULTIPLIER : motionX, canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ),
4748
new MovementOption(Input.MOVE_BACK, -motionX, -motionZ),
4849
new MovementOption(Input.MOVE_LEFT, -motionZ, motionX),
4950
new MovementOption(Input.MOVE_RIGHT, motionZ, -motionX),
50-
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_LEFT, (canSprint ? motionX * 1.3f : motionX) - motionZ, (canSprint ? motionZ * 1.3f : motionZ) + motionX),
51-
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_RIGHT, (canSprint ? motionX * 1.3f : motionX) + motionZ, (canSprint ? motionZ * 1.3f : motionZ) - motionX),
51+
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_LEFT, (canSprint ? motionX * SPRINT_MULTIPLIER : motionX) - motionZ, (canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ) + motionX),
52+
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_RIGHT, (canSprint ? motionX * SPRINT_MULTIPLIER : motionX) + motionZ, (canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ) - motionX),
5253
new MovementOption(Input.MOVE_BACK, Input.MOVE_LEFT, -motionX - motionZ, -motionZ + motionX),
5354
new MovementOption(Input.MOVE_BACK, Input.MOVE_RIGHT, -motionX + motionZ, -motionZ - motionX)
5455
);

0 commit comments

Comments
 (0)