CombatEntry .java

net.minecraft.util.CombatEntry (class, 60 lines): members: getDamageSrcDisplayName, isLivingDamageSrc, field_94566_e, field_94567_b, func_94562_g, damage.

net.minecraft.utilclass60 linescommon1.6 KB

API Surface (6)

DamageSource getDamageSrc()
float func_94563_c()
boolean isLivingDamageSrc()
String func_94562_g()
IChatComponent getDamageSrcDisplayName()
float getDamageAmount()

Fields & Constants (6)

damageSrc
field_94567_b
damage
health
field_94566_e
fallDistance

Code Graph: Dependencies (3)

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

Full Source

CombatEntry.java60 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.util;
2
3
import net.minecraft.entity.EntityLivingBase;
4
5
public class CombatEntry
6
{
7
    private final DamageSource damageSrc;
8
    private final int field_94567_b;
9
    private final float damage;
10
    private final float health;
11
    private final String field_94566_e;
12
    private final float fallDistance;
13
14
    public CombatEntry(DamageSource damageSrcIn, int p_i1564_2_, float healthAmount, float damageAmount, String p_i1564_5_, float fallDistanceIn)
15
    {
16
        this.damageSrc = damageSrcIn;
17
        this.field_94567_b = p_i1564_2_;
18
        this.damage = damageAmount;
19
        this.health = healthAmount;
20
        this.field_94566_e = p_i1564_5_;
21
        this.fallDistance = fallDistanceIn;
22
    }
23
24
    /**
25
     * Get the DamageSource of the CombatEntry instance.
26
     */
27
    public DamageSource getDamageSrc()
28
    {
29
        return this.damageSrc;
30
    }
31
32
    public float func_94563_c()
33
    {
34
        return this.damage;
35
    }
36
37
    /**
38
     * Returns true if {@link net.minecraft.util.DamageSource#getEntity() damage source} is a living entity
39
     */
40
    public boolean isLivingDamageSrc()
41
    {
42
        return this.damageSrc.getEntity() instanceof EntityLivingBase;
43
    }
44
45
    public String func_94562_g()
46
    {
47
        return this.field_94566_e;
48
    }
49
50
    public IChatComponent getDamageSrcDisplayName()
51
    {
52
        return this.getDamageSrc().getEntity() == null ? null : this.getDamageSrc().getEntity().getDisplayName();
53
    }
54
55
    public float getDamageAmount()
56
    {
57
        return this.damageSrc == DamageSource.outOfWorld ? Float.MAX_VALUE : this.fallDistance;
58
    }
59
}
60

Deobfuscated MCP 1.8.9 source of CombatEntry from Marcelektro/MavenMCP-1.8.9 (net/minecraft/util/CombatEntry.java), stored verbatim.