001 package net.minecraft.src;
002
003 public class EntityDragonPart extends Entity
004 {
005 /** The dragon entity this dragon part belongs to */
006 public final EntityDragonBase entityDragonObj;
007
008 /** The name of the Dragon Part */
009 public final String name;
010
011 public EntityDragonPart(EntityDragonBase par1EntityDragonBase, String par2Str, float par3, float par4)
012 {
013 super(par1EntityDragonBase.worldObj);
014 this.setSize(par3, par4);
015 this.entityDragonObj = par1EntityDragonBase;
016 this.name = par2Str;
017 }
018
019 protected void entityInit() {}
020
021 /**
022 * (abstract) Protected helper method to read subclass entity data from NBT.
023 */
024 protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {}
025
026 /**
027 * (abstract) Protected helper method to write subclass entity data to NBT.
028 */
029 protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {}
030
031 /**
032 * Returns true if other Entities should be prevented from moving through this Entity.
033 */
034 public boolean canBeCollidedWith()
035 {
036 return true;
037 }
038
039 /**
040 * Called when the entity is attacked.
041 */
042 public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
043 {
044 return this.entityDragonObj.attackEntityFromPart(this, par1DamageSource, par2);
045 }
046
047 /**
048 * Returns true if Entity argument is equal to this Entity
049 */
050 public boolean isEntityEqual(Entity par1Entity)
051 {
052 return this == par1Entity || this.entityDragonObj == par1Entity;
053 }
054 }