summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityFlying.java
blob: 165d24b7f4ff6b9e98528819e577edbd9075eaf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package net.minecraft.server;

public class EntityFlying extends EntityLiving {

    public EntityFlying(World world) {
        super(world);
    }

    protected void a(float f) {}

    public void c(float f, float f1) {
        if (v()) {
            a(f, f1, 0.02F);
            c(s, t, u);
            s *= 0.80000001192092896D;
            t *= 0.80000001192092896D;
            u *= 0.80000001192092896D;
        } else if (x()) {
            a(f, f1, 0.02F);
            c(s, t, u);
            s *= 0.5D;
            t *= 0.5D;
            u *= 0.5D;
        } else {
            float f2 = 0.91F;

            if (A) {
                f2 = 0.5460001F;
                int i = l.a(MathHelper.b(p), MathHelper.b(z.b) - 1, MathHelper.b(r));

                if (i > 0) {
                    f2 = Block.m[i].bu * 0.91F;
                }
            }
            float f3 = 0.1627714F / (f2 * f2 * f2);

            a(f, f1, A ? 0.1F * f3 : 0.02F);
            f2 = 0.91F;
            if (A) {
                f2 = 0.5460001F;
                int j = l.a(MathHelper.b(p), MathHelper.b(z.b) - 1, MathHelper.b(r));

                if (j > 0) {
                    f2 = Block.m[j].bu * 0.91F;
                }
            }
            c(s, t, u);
            s *= f2;
            t *= f2;
            u *= f2;
        }
        bl = bm;
        double d = p - m;
        double d1 = r - o;
        float f4 = MathHelper.a(d * d + d1 * d1) * 4F;

        if (f4 > 1.0F) {
            f4 = 1.0F;
        }
        bm += (f4 - bm) * 0.4F;
        bn += bm;
    }

    public boolean m() {
        return false;
    }
}