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