Paper/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java

35 Zeilen
1.2 KiB
Java

package net.minecraft.server;
public class EntityDamageSourceIndirect extends EntityDamageSource {
private Entity owner;
public EntityDamageSourceIndirect(String s, Entity entity, Entity entity1) {
super(s, entity);
this.owner = entity1;
2012-01-12 23:10:13 +01:00
}
2013-03-13 23:33:27 +01:00
public Entity h() {
return this.p;
}
public Entity getEntity() {
return this.owner;
}
2013-07-01 13:03:00 +02:00
public ChatMessage getLocalizedDeathMessage(EntityLiving entityliving) {
2013-03-13 23:33:27 +01:00
String s = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
2013-09-19 20:25:08 +02:00
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).aZ() : null;
2013-03-13 23:33:27 +01:00
String s1 = "death.attack." + this.translationIndex;
String s2 = s1 + ".item";
2013-07-01 13:03:00 +02:00
return itemstack != null && itemstack.hasName() && LocaleI18n.b(s2) ? ChatMessage.b(s2, new Object[] { entityliving.getScoreboardDisplayName(), s, itemstack.getName()}) : ChatMessage.b(s1, new Object[] { entityliving.getScoreboardDisplayName(), s});
}
2012-11-06 13:05:28 +01:00
// CraftBukkit start
public Entity getProximateDamageSource() {
return super.getEntity();
}
2012-11-06 13:05:28 +01:00
// CraftBukkit end
}