001 package net.minecraft.src;
002
003 public class EntityDamageSourceIndirect extends EntityDamageSource
004 {
005 private Entity indirectEntity;
006
007 public EntityDamageSourceIndirect(String par1Str, Entity par2Entity, Entity par3Entity)
008 {
009 super(par1Str, par2Entity);
010 this.indirectEntity = par3Entity;
011 }
012
013 public Entity getSourceOfDamage()
014 {
015 return this.damageSourceEntity;
016 }
017
018 public Entity getEntity()
019 {
020 return this.indirectEntity;
021 }
022
023 /**
024 * Returns the message to be displayed on player death.
025 */
026 public String getDeathMessage(EntityPlayer par1EntityPlayer)
027 {
028 return StatCollector.translateToLocalFormatted("death." + this.damageType, new Object[] {par1EntityPlayer.username, this.indirectEntity.getEntityName()});
029 }
030 }