Handles updating while being ridden by an entity
()
| 1937 | * Handles updating while being ridden by an entity |
| 1938 | */ |
| 1939 | public void updateRidden() |
| 1940 | { |
| 1941 | if (this.ridingEntity.isDead) |
| 1942 | { |
| 1943 | this.ridingEntity = null; |
| 1944 | } |
| 1945 | else |
| 1946 | { |
| 1947 | this.motionX = 0.0D; |
| 1948 | this.motionY = 0.0D; |
| 1949 | this.motionZ = 0.0D; |
| 1950 | this.onUpdate(); |
| 1951 | |
| 1952 | if (this.ridingEntity != null) |
| 1953 | { |
| 1954 | this.ridingEntity.updateRiderPosition(); |
| 1955 | this.entityRiderYawDelta += this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw; |
| 1956 | |
| 1957 | for (this.entityRiderPitchDelta += this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch; this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) |
| 1958 | { |
| 1959 | ; |
| 1960 | } |
| 1961 | |
| 1962 | while (this.entityRiderYawDelta < -180.0D) |
| 1963 | { |
| 1964 | this.entityRiderYawDelta += 360.0D; |
| 1965 | } |
| 1966 | |
| 1967 | while (this.entityRiderPitchDelta >= 180.0D) |
| 1968 | { |
| 1969 | this.entityRiderPitchDelta -= 360.0D; |
| 1970 | } |
| 1971 | |
| 1972 | while (this.entityRiderPitchDelta < -180.0D) |
| 1973 | { |
| 1974 | this.entityRiderPitchDelta += 360.0D; |
| 1975 | } |
| 1976 | |
| 1977 | double d0 = this.entityRiderYawDelta * 0.5D; |
| 1978 | double d1 = this.entityRiderPitchDelta * 0.5D; |
| 1979 | float f = 10.0F; |
| 1980 | |
| 1981 | if (d0 > (double)f) |
| 1982 | { |
| 1983 | d0 = f; |
| 1984 | } |
| 1985 | |
| 1986 | if (d0 < (double)(-f)) |
| 1987 | { |
| 1988 | d0 = -f; |
| 1989 | } |
| 1990 | |
| 1991 | if (d1 > (double)f) |
| 1992 | { |
| 1993 | d1 = f; |
| 1994 | } |
| 1995 | |
| 1996 | if (d1 < (double)(-f)) |
no test coverage detected