summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java
blob: 19121530a3a8669f3167c72f26b0cac31bc6f4b0 (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
package net.minecraft.server;

public class EntityDamageSourceIndirect extends EntityDamageSource {

    private Entity owner;

    public EntityDamageSourceIndirect(String s, Entity entity, Entity entity1) {
        super(s, entity);
        this.owner = entity1;
    }

    public Entity h() {
        return this.p;
    }

    public Entity getEntity() {
        return this.owner;
    }

    public String getLocalizedDeathMessage(EntityLiving entityliving) {
        String s = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
        ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).bG() : null;
        String s1 = "death.attack." + this.translationIndex;
        String s2 = s1 + ".item";

        return itemstack != null && itemstack.hasName() && LocaleI18n.b(s2) ? LocaleI18n.get(s2, new Object[] { entityliving.getScoreboardDisplayName(), s, itemstack.getName()}) : LocaleI18n.get(s1, new Object[] { entityliving.getScoreboardDisplayName(), s});
    }

    // CraftBukkit start
    public Entity getProximateDamageSource() {
        return super.getEntity();
    }
    // CraftBukkit end
}