diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /src/main/java/net/minecraft/server/ControllerLook.java | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'src/main/java/net/minecraft/server/ControllerLook.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ControllerLook.java | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/main/java/net/minecraft/server/ControllerLook.java b/src/main/java/net/minecraft/server/ControllerLook.java deleted file mode 100644 index f1e8b3dc..00000000 --- a/src/main/java/net/minecraft/server/ControllerLook.java +++ /dev/null @@ -1,87 +0,0 @@ -package net.minecraft.server; - -import org.bukkit.craftbukkit.TrigMath; // CraftBukkit - -public class ControllerLook { - - private EntityInsentient a; - private float b; - private float c; - private boolean d; - private double e; - private double f; - private double g; - - public ControllerLook(EntityInsentient entityinsentient) { - this.a = entityinsentient; - } - - public void a(Entity entity, float f, float f1) { - this.e = entity.locX; - if (entity instanceof EntityLiving) { - this.f = entity.locY + (double) entity.getHeadHeight(); - } else { - this.f = (entity.boundingBox.b + entity.boundingBox.e) / 2.0D; - } - - this.g = entity.locZ; - this.b = f; - this.c = f1; - this.d = true; - } - - public void a(double d0, double d1, double d2, float f, float f1) { - this.e = d0; - this.f = d1; - this.g = d2; - this.b = f; - this.c = f1; - this.d = true; - } - - public void a() { - this.a.pitch = 0.0F; - if (this.d) { - this.d = false; - double d0 = this.e - this.a.locX; - double d1 = this.f - (this.a.locY + (double) this.a.getHeadHeight()); - double d2 = this.g - this.a.locZ; - double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); - // CraftBukkit start - Math -> TrigMath - float f = (float) (TrigMath.atan2(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; - float f1 = (float) (-(TrigMath.atan2(d1, d3) * 180.0D / 3.1415927410125732D)); - // CraftBukkit end - - this.a.pitch = this.a(this.a.pitch, f1, this.c); - this.a.aO = this.a(this.a.aO, f, this.b); - } else { - this.a.aO = this.a(this.a.aO, this.a.aM, 10.0F); - } - - float f2 = MathHelper.g(this.a.aO - this.a.aM); - - if (!this.a.getNavigation().g()) { - if (f2 < -75.0F) { - this.a.aO = this.a.aM - 75.0F; - } - - if (f2 > 75.0F) { - this.a.aO = this.a.aM + 75.0F; - } - } - } - - private float a(float f, float f1, float f2) { - float f3 = MathHelper.g(f1 - f); - - if (f3 > f2) { - f3 = f2; - } - - if (f3 < -f2) { - f3 = -f2; - } - - return f + f3; - } -} |