88import net .minecraft .enchantment .EnchantmentHelper ;
99import net .minecraft .entity .Entity ;
1010import net .minecraft .entity .EntityLivingBase ;
11- import net .minecraft .entity .SharedMonsterAttributes ;
1211import net .minecraft .entity .player .EntityPlayer ;
1312import net .minecraft .item .ItemStack ;
1413import net .minecraft .nbt .NBTTagCompound ;
@@ -21,7 +20,7 @@ public class EntityDragon extends EntityTameableFlying {
2120
2221 private static final String NBT_IS_STARTLED = "IsStartled" ;
2322
24- protected boolean isStartled = false ;
23+ protected boolean startled = false ;
2524
2625 public EntityDragon (World world ) {
2726 super (world );
@@ -32,7 +31,7 @@ public EntityDragon(World world) {
3231 @ Override
3332 protected void applyEntityAttributes () {
3433 super .applyEntityAttributes ();
35- this .getAttributeMap ().registerAttribute (SharedMonsterAttributes . attackDamage );
34+ this .getAttributeMap ().registerAttribute (damageAtt );
3635 }
3736
3837 public boolean isRideableBy (Entity rider ) {
@@ -90,16 +89,13 @@ public boolean onFeed(EntityLivingBase feeder, ItemStack feed) {
9089
9190 public boolean interact (EntityPlayer ply ) {
9291 ItemStack hand = ply .getCurrentEquippedItem ();
93- if (hand == null )
94- ;
95- else if (HTTYMDMod .getConfig ().isDebugMode () && hand .getItem () == ItemRegistry .wing ) {
96- this .onTakeoff ();
97- return true ;
98- } else if (ItemUtils .isFood (hand )) {
99- boolean feed = this .onFeed (ply , hand ); // Running twice might cause problems
100- if (this .canTame (ply , hand ) && feed ); // Prevents double taking of tame items
101- else if (feed && !ply .capabilities .isCreativeMode && --hand .stackSize <= 0 )
102- ply .inventory .setInventorySlotContents (ply .inventory .currentItem , (ItemStack ) null );
92+ if (hand != null ) {
93+ if (HTTYMDMod .getConfig ().isDebugMode () && hand .getItem () == ItemRegistry .wing ) {
94+ this .onTakeoff ();
95+ return true ;
96+ } else if (ItemUtils .isFood (hand ) && !this .canTame (ply , hand ) &&
97+ this .onFeed (ply , hand ) && !ply .capabilities .isCreativeMode && --hand .stackSize <= 0 )
98+ ply .inventory .setInventorySlotContents (ply .inventory .currentItem , (ItemStack ) null );
10399 }
104100
105101 if (this .isOwner (ply ) && this .isRideableBy (ply )) {
@@ -112,7 +108,6 @@ else if(feed && !ply.capabilities.isCreativeMode && --hand.stackSize <= 0)
112108 @ Override
113109 public boolean attackEntityAsMob (Entity target ) {
114110 double damage = 2.0D ;
115-
116111 int knockback = 0 ;
117112
118113 if (target instanceof EntityLivingBase ) {
@@ -153,7 +148,7 @@ public boolean isAngry() {
153148 }
154149
155150 public boolean isStartled () {
156- return this .isStartled ;
151+ return this .startled ;
157152 }
158153
159154 public boolean isTameable (EntityLivingBase tamer ) {
@@ -170,12 +165,12 @@ public void readEntityFromNBT(NBTTagCompound tag) {
170165 * Sets whether this dragon is angry or not.
171166 */
172167 public void setAngry (boolean p_70916_1_ ) {
173- byte b0 = this .dataWatcher .getWatchableObjectByte (BOOL_WATCHER );
168+ byte boolByte = this .dataWatcher .getWatchableObjectByte (BOOL_WATCHER );
174169
175170 if (p_70916_1_ )
176- this .dataWatcher .updateObject (16 , Byte .valueOf ((byte ) (b0 | BOOL_IS_ANGRY )));
171+ this .dataWatcher .updateObject (16 , Byte .valueOf ((byte ) (boolByte | BOOL_IS_ANGRY )));
177172 else
178- this .dataWatcher .updateObject (16 , Byte .valueOf ((byte ) (b0 & -(BOOL_IS_ANGRY + 1 ))));
173+ this .dataWatcher .updateObject (16 , Byte .valueOf ((byte ) (boolByte & -(BOOL_IS_ANGRY + 1 ))));
179174 }
180175
181176 public void setAttackTarget (EntityLivingBase p_70624_1_ ) {
@@ -188,7 +183,7 @@ else if (!this.isTamed())
188183 }
189184
190185 public void setStartled (boolean startled ) {
191- this .isStartled = startled ;
186+ this .startled = startled ;
192187 }
193188
194189 @ Override
0 commit comments