You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.4 KiB
Java
36 lines
1.4 KiB
Java
package net.minecraft.util;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
public class EntityDamageSourceIndirect extends EntityDamageSource
|
|
{
|
|
private Entity indirectEntity;
|
|
private static final String __OBFID = "CL_00001523";
|
|
|
|
public EntityDamageSourceIndirect(String p_i1568_1_, Entity p_i1568_2_, Entity p_i1568_3_)
|
|
{
|
|
super(p_i1568_1_, p_i1568_2_);
|
|
this.indirectEntity = p_i1568_3_;
|
|
}
|
|
|
|
public Entity getSourceOfDamage()
|
|
{
|
|
return this.damageSourceEntity;
|
|
}
|
|
|
|
public Entity getEntity()
|
|
{
|
|
return this.indirectEntity;
|
|
}
|
|
|
|
public IChatComponent func_151519_b(EntityLivingBase p_151519_1_)
|
|
{
|
|
IChatComponent ichatcomponent = this.indirectEntity == null ? this.damageSourceEntity.func_145748_c_() : this.indirectEntity.func_145748_c_();
|
|
ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null;
|
|
String s = "death.attack." + this.damageType;
|
|
String s1 = s + ".item";
|
|
return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {p_151519_1_.func_145748_c_(), ichatcomponent, itemstack.func_151000_E()}): new ChatComponentTranslation(s, new Object[] {p_151519_1_.func_145748_c_(), ichatcomponent});
|
|
}
|
|
} |