Upload files to "src/openonyx/utilities"
This commit is contained in:
1 parent
f1c22fce7f
commit
9040c85bb4
5 files changed
+216
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package openonyx.utilities;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import openonyx.core.MinecraftAccess;
|
||||
import openonyx.protocol.group_m.Angles;
|
||||
|
||||
public final class RotationRayTrace implements MinecraftAccess {
|
||||
public static MovingObjectPosition L(Entity entity, double d, Angles angles) {
|
||||
Entity entity1;
|
||||
if ((entity1 = mc.getRenderViewEntity()) != null && entity != null) {
|
||||
Vec3 vec32 = entity1.getPositionEyes(1.0F);
|
||||
Vec3 vec3 = angles.L();
|
||||
Vec3 vec31 = vec32.addVector(vec3.xCoord * d, vec3.yCoord * d, vec3.zCoord * d);
|
||||
float f = entity.getCollisionBorderSize();
|
||||
MovingObjectPosition movingObjectPosition;
|
||||
return (movingObjectPosition = entity.getEntityBoundingBox().expand(f, f, f).calculateIntercept(vec32, vec31)) == null
|
||||
? null
|
||||
: new MovingObjectPosition(entity, movingObjectPosition.hitVec);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private RotationRayTrace() {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user