summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntitySpider.java
blob: ee01de3133261ac6f3f006091eb8abef8fc59af2 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package net.minecraft.server;

import java.util.Random;

//CraftBukkit start
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.entity.CraftSpider;
//CraftBukkit stop

public class EntitySpider extends EntityMobs {

    public EntitySpider(World world) {
        super(world);
        aP = "/mob/spider.png";
        a(1.4F, 0.9F);
        bC = 0.8F;
        //CraftBukkit start
        CraftServer server = ((WorldServer) this.l).getServer();
        this.bukkitEntity = new CraftSpider(server, this);
        //CraftBukkit end
    }

    public double k() {
        return (double) J * 0.75D - 0.5D;
    }

    protected Entity l() {
        float f1 = b(1.0F);

        if (f1 < 0.5F) {
            double d = 16D;

            return ((Entity) (l.a(((Entity) (this)), d)));
        } else {
            return null;
        }
    }

    protected String e() {
        return "mob.spider";
    }

    protected String f() {
        return "mob.spider";
    }

    protected String g() {
        return "mob.spiderdeath";
    }

    protected void a(Entity entity, float f1) {
        float f2 = b(1.0F);

        if (f2 > 0.5F && W.nextInt(100) == 0) {
            this.d = null;
            return;
        }
        if (f1 > 2.0F && f1 < 6F && W.nextInt(10) == 0) {
            if (A) {
                double d = entity.p - p;
                double d1 = entity.r - r;
                float f3 = MathHelper.a(d * d + d1 * d1);

                s = (d / (double) f3) * 0.5D * 0.80000001192092896D + s * 0.20000000298023224D;
                u = (d1 / (double) f3) * 0.5D * 0.80000001192092896D + u * 0.20000000298023224D;
                t = 0.40000000596046448D;
            }
        } else {
            super.a(entity, f1);
        }
    }

    public void a(NBTTagCompound nbttagcompound) {
        super.a(nbttagcompound);
    }

    public void b(NBTTagCompound nbttagcompound) {
        super.b(nbttagcompound);
    }

    protected int h() {
        return Item.I.ba;
    }

    public boolean m() {
        return B;
    }
}