Skip to content

Commit 0dc334c

Browse files
committed
Add nullability annotations to SubHitBlockHitResult.
1 parent 52f6b12 commit 0dc334c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/codechicken/lib/raytracer/SubHitBlockHitResult.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
import net.minecraft.core.Direction;
66
import net.minecraft.world.phys.BlockHitResult;
77
import net.minecraft.world.phys.Vec3;
8+
import org.jetbrains.annotations.Nullable;
89

910
public class SubHitBlockHitResult extends BlockHitResult implements Comparable<SubHitBlockHitResult> {
1011

1112
/**
1213
* The square distance from the start of the raytrace.
1314
*/
1415
public final double dist;
15-
public final Object hitInfo;
16+
public final @Nullable Object hitInfo;
1617
public final int subHit;
1718

18-
public SubHitBlockHitResult(Vector3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, Object data, double dist) {
19+
public SubHitBlockHitResult(Vector3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, @Nullable Object data, double dist) {
1920
this(false, hitVec.vec3(), faceIn, posIn, isInside, data, dist);
2021
}
2122

22-
public SubHitBlockHitResult(Vec3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, Object data, double dist) {
23+
public SubHitBlockHitResult(Vec3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, @Nullable Object data, double dist) {
2324
this(false, hitVec, faceIn, posIn, isInside, data, dist);
2425
}
2526

26-
protected SubHitBlockHitResult(boolean isMissIn, Vec3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, Object data, double dist) {
27+
protected SubHitBlockHitResult(boolean isMissIn, Vec3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, @Nullable Object data, double dist) {
2728
super(isMissIn, hitVec, faceIn, posIn, isInside);
2829
if (data instanceof Integer d) {
2930
subHit = d;

0 commit comments

Comments
 (0)