2011-09-21 01:50:35 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
public class EntityDamageSourceIndirect extends EntityDamageSource {
|
|
|
|
|
2012-01-14 21:03:48 +01:00
|
|
|
private Entity owner;
|
2011-09-21 01:50:35 +02:00
|
|
|
|
|
|
|
public EntityDamageSourceIndirect(String s, Entity entity, Entity entity1) {
|
|
|
|
super(s, entity);
|
2012-01-14 21:03:48 +01:00
|
|
|
this.owner = entity1;
|
2012-01-12 23:10:13 +01:00
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public Entity i() {
|
2013-03-13 23:33:27 +01:00
|
|
|
return this.p;
|
2011-09-21 01:50:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Entity getEntity() {
|
2012-01-14 21:03:48 +01:00
|
|
|
return this.owner;
|
2011-09-21 01:50:35 +02:00
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public IChatBaseComponent getLocalizedDeathMessage(EntityLiving entityliving) {
|
|
|
|
IChatBaseComponent ichatbasecomponent = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
|
2014-03-21 05:26:30 +01:00
|
|
|
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).bd() : null;
|
2013-11-04 14:07:38 +01:00
|
|
|
String s = "death.attack." + this.translationIndex;
|
|
|
|
String s1 = s + ".item";
|
2013-03-13 23:33:27 +01:00
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
return itemstack != null && itemstack.hasName() && LocaleI18n.c(s1) ? new ChatMessage(s1, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.E()}) : new ChatMessage(s, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent});
|
2011-12-27 19:56:46 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
// CraftBukkit start
|
2011-12-27 19:56:46 +01:00
|
|
|
public Entity getProximateDamageSource() {
|
|
|
|
return super.getEntity();
|
2011-09-21 01:50:35 +02:00
|
|
|
}
|
2012-11-06 13:05:28 +01:00
|
|
|
// CraftBukkit end
|
2011-12-27 19:56:46 +01:00
|
|
|
}
|