This commit is contained in:
Auxilor 2022-07-21 15:44:32 +01:00
parent 97645ada4d
commit ad69c34a20

View File

@ -4,19 +4,16 @@ import org.bukkit.util.Vector;
public class VelocityChecks { public class VelocityChecks {
/** /**
* Checks to see if the velocity is unsafe. This is taken from Papers 0054-Add-velocity-warnings.patch * Checks to see if the velocity is unsafe. This is taken from Papers 0054-Add-velocity-warnings.patch.
* @param vel *
* @return * @param vel The velocity.
* @return If unsafe.
*/ */
public static boolean isUnsafeVelocity(Vector vel) { public static boolean isUnsafeVelocity(Vector vel) {
final double x = vel.getX(); final double x = vel.getX();
final double y = vel.getY(); final double y = vel.getY();
final double z = vel.getZ(); final double z = vel.getZ();
if (x > 4 || x < -4 || y > 4 || y < -4 || z > 4 || z < -4) { return x > 4 || x < -4 || y > 4 || y < -4 || z > 4 || z < -4;
return true;
}
return false;
} }
} }