|
5 | 5 | import net.minecraft.core.Direction; |
6 | 6 | import net.minecraft.world.phys.BlockHitResult; |
7 | 7 | import net.minecraft.world.phys.Vec3; |
| 8 | +import org.jetbrains.annotations.Nullable; |
8 | 9 |
|
9 | 10 | public class SubHitBlockHitResult extends BlockHitResult implements Comparable<SubHitBlockHitResult> { |
10 | 11 |
|
11 | 12 | /** |
12 | 13 | * The square distance from the start of the raytrace. |
13 | 14 | */ |
14 | 15 | public final double dist; |
15 | | - public final Object hitInfo; |
| 16 | + public final @Nullable Object hitInfo; |
16 | 17 | public final int subHit; |
17 | 18 |
|
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) { |
19 | 20 | this(false, hitVec.vec3(), faceIn, posIn, isInside, data, dist); |
20 | 21 | } |
21 | 22 |
|
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) { |
23 | 24 | this(false, hitVec, faceIn, posIn, isInside, data, dist); |
24 | 25 | } |
25 | 26 |
|
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) { |
27 | 28 | super(isMissIn, hitVec, faceIn, posIn, isInside); |
28 | 29 | if (data instanceof Integer d) { |
29 | 30 | subHit = d; |
|
0 commit comments