EntityExpBottle .java

net.minecraft.entity.item.EntityExpBottle (class): members: getGravityVelocity, getInaccuracy, getVelocity, onImpact. imports: EntityThrowable, World.

net.minecraft.entity.itemclass65 linescommonextends EntityThrowable1.5 KB

API Surface (4)

float getGravityVelocity()
float getVelocity()
float getInaccuracy()
void onImpact(MovingObjectPosition p_70184_1_)

Code Graph: Dependencies (6)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EntityExpBottle.java65 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.entity.item;
2
3
import net.minecraft.entity.EntityLivingBase;
4
import net.minecraft.entity.projectile.EntityThrowable;
5
import net.minecraft.util.BlockPos;
6
import net.minecraft.util.MovingObjectPosition;
7
import net.minecraft.world.World;
8
9
public class EntityExpBottle extends EntityThrowable
10
{
11
    public EntityExpBottle(World worldIn)
12
    {
13
        super(worldIn);
14
    }
15
16
    public EntityExpBottle(World worldIn, EntityLivingBase p_i1786_2_)
17
    {
18
        super(worldIn, p_i1786_2_);
19
    }
20
21
    public EntityExpBottle(World worldIn, double x, double y, double z)
22
    {
23
        super(worldIn, x, y, z);
24
    }
25
26
    /**
27
     * Gets the amount of gravity to apply to the thrown entity with each tick.
28
     */
29
    protected float getGravityVelocity()
30
    {
31
        return 0.07F;
32
    }
33
34
    protected float getVelocity()
35
    {
36
        return 0.7F;
37
    }
38
39
    protected float getInaccuracy()
40
    {
41
        return -20.0F;
42
    }
43
44
    /**
45
     * Called when this EntityThrowable hits a block or entity.
46
     */
47
    protected void onImpact(MovingObjectPosition p_70184_1_)
48
    {
49
        if (!this.worldObj.isRemote)
50
        {
51
            this.worldObj.playAuxSFX(2002, new BlockPos(this), 0);
52
            int i = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5);
53
54
            while (i > 0)
55
            {
56
                int j = EntityXPOrb.getXPSplit(i);
57
                i -= j;
58
                this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j));
59
            }
60
61
            this.setDead();
62
        }
63
    }
64
}
65

Deobfuscated MCP 1.8.9 source of EntityExpBottle from Marcelektro/MavenMCP-1.8.9 (net/minecraft/entity/item/EntityExpBottle.java), stored verbatim.