2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.util;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2014-02-05 10:28:54 -05:00
|
|
|
import net.minecraft.util.ChatComponentTranslation;
|
|
|
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
|
import net.minecraft.util.IChatComponent;
|
|
|
|
|
import net.minecraft.util.StatCollector;
|
2014-02-01 17:28:41 +11:00
|
|
|
import tconstruct.library.tools.AbilityHelper;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
public class SmelteryDamageSource extends DamageSource
|
|
|
|
|
{
|
|
|
|
|
public SmelteryDamageSource()
|
|
|
|
|
{
|
|
|
|
|
super("smeltery");
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-01 17:28:41 +11:00
|
|
|
@Override
|
|
|
|
|
public IChatComponent func_151519_b (EntityLivingBase par1EntityLiving)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
String type = "";
|
|
|
|
|
switch (AbilityHelper.random.nextInt(4))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
type = "one.";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
type = "two.";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
type = "three.";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
type = "four.";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
EntityLivingBase entityliving1 = par1EntityLiving.func_94060_bK();
|
|
|
|
|
String s = "death." + type + this.damageType;
|
|
|
|
|
String s1 = s + ".player";
|
2014-02-05 09:11:06 -05:00
|
|
|
return entityliving1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] { par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_() })
|
|
|
|
|
: new ChatComponentTranslation(s, new Object[] { par1EntityLiving.func_145748_c_() });
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|