package net.minecraft.server;
import javax.annotation.Nullable;
public class EntityDamageSourceIndirect extends EntityDamageSource {
private final Entity owner;
public EntityDamageSourceIndirect(String s, Entity entity, @Nullable Entity entity1) {
super(s, entity);
this.owner = entity1;
}
@Nullable
public Entity i() {
return this.v;
}
@Nullable
public Entity getEntity() {
return this.owner;
}
public IChatBaseComponent getLocalizedDeathMessage(EntityLiving entityliving) {
IChatBaseComponent ichatbasecomponent = this.owner == null ? this.v.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).getItemInMainHand() : ItemStack.a;
String s = "death.attack." + this.translationIndex;
String s1 = s + ".item";
return !itemstack.isEmpty() && itemstack.hasName() && LocaleI18n.c(s1) ? new ChatMessage(s1, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.C()}) : new ChatMessage(s, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent});
}
// CraftBukkit start
public Entity getProximateDamageSource() {
return super.getEntity();
}
// CraftBukkit end
}