|
13 | 13 | import net.minecraft.world.waypoints.PartialTickSupplier; |
14 | 14 | import net.minecraft.world.waypoints.TrackedWaypoint; |
15 | 15 | import net.minecraft.world.waypoints.Waypoint; |
| 16 | +import org.jspecify.annotations.NonNull; |
| 17 | +import org.jspecify.annotations.Nullable; |
16 | 18 |
|
17 | 19 | import static cameratweaks.Util.*; |
18 | 20 |
|
19 | 21 | @SuppressWarnings("DataFlowIssue") |
20 | 22 | public class Freecam { |
21 | 23 | private static final Util.Pos[] cameras = new Util.Pos[9]; |
22 | | - public static Util.LerpedPos pos; |
| 24 | + public static Util.@Nullable LerpedPos pos; |
23 | 25 | public static float speed; |
24 | 26 |
|
25 | 27 | public static void enable() { |
@@ -107,18 +109,18 @@ private static class FreecamWaypoint extends TrackedWaypoint { |
107 | 109 | } |
108 | 110 |
|
109 | 111 | @Override |
110 | | - public void update(TrackedWaypoint waypoint) {} |
| 112 | + public void update(@NonNull TrackedWaypoint waypoint) {} |
111 | 113 | @Override |
112 | | - public void writeContents(ByteBuf buf) {} |
| 114 | + public void writeContents(@NonNull ByteBuf buf) {} |
113 | 115 |
|
114 | 116 | @Override |
115 | | - public double yawAngleToCamera(Level level, Camera camera, PartialTickSupplier partialTickSupplier) { |
| 117 | + public double yawAngleToCamera(@NonNull Level level, Camera camera, @NonNull PartialTickSupplier partialTickSupplier) { |
116 | 118 | Vec3 vec3 = camera.position().subtract(client.getCameraEntity().position()).rotateClockwise90(); |
117 | 119 | return Mth.degreesDifference(camera.yaw(), (float) Mth.atan2(vec3.z(), vec3.x()) * Mth.RAD_TO_DEG); |
118 | 120 | } |
119 | 121 |
|
120 | 122 | @Override |
121 | | - public PitchDirection pitchDirectionToCamera(Level level, Projector projector, PartialTickSupplier partialTickSupplier) { |
| 123 | + public @NonNull PitchDirection pitchDirectionToCamera(@NonNull Level level, Projector projector, @NonNull PartialTickSupplier partialTickSupplier) { |
122 | 124 | Vec3 vec3 = projector.projectPointToScreen(client.getCameraEntity().getEyePosition()); |
123 | 125 | boolean bl = vec3.z > 1.0; |
124 | 126 | double d = bl ? -vec3.y : vec3.y; |
|
0 commit comments