Fix Matter Cannon Range (to 1.7.10 range)

This commit is contained in:
Sebastian Hartte
2020-06-20 01:33:33 +02:00
parent fcdd0bc378
commit daaac300b8
2 changed files with 22 additions and 14 deletions
+5 -2
View File
@@ -797,6 +797,11 @@ public class Platform {
// }
public static LookDirection getPlayerRay(final PlayerEntity playerIn) {
double reachDistance = playerIn.getAttribute(PlayerEntity.REACH_DISTANCE).getValue();
return getPlayerRay(playerIn, reachDistance);
}
public static LookDirection getPlayerRay(final PlayerEntity playerIn, double reachDistance) {
final double x = playerIn.prevPosX + (playerIn.getPosX() - playerIn.prevPosX);
final double y = playerIn.prevPosY + (playerIn.getPosY() - playerIn.prevPosY) + playerIn.getEyeHeight();
final double z = playerIn.prevPosZ + (playerIn.getPosZ() - playerIn.prevPosZ);
@@ -812,8 +817,6 @@ public class Platform {
final float eyeRayX = yawRayX * pitchMultiplier;
final float eyeRayZ = yawRayZ * pitchMultiplier;
double reachDistance = playerIn.getAttribute(PlayerEntity.REACH_DISTANCE).getValue();
final Vec3d from = new Vec3d(x, y, z);
final Vec3d to = from.add(eyeRayX * reachDistance, eyeRayY * reachDistance, eyeRayZ * reachDistance);