@@ -64,17 +64,12 @@ public EntityAscendedFlyingLemur(World worldIn)
6464 this .moveHelper = new EntityFlyHelper (this );
6565 experienceValue = 200 ;
6666 }
67-
68-
69-
7067 @ Nullable
7168 public IEntityLivingData onInitialSpawn (DifficultyInstance difficulty , @ Nullable IEntityLivingData livingdata )
7269 {
7370 this .setVariant (this .rand .nextInt (2 ));
7471 return super .onInitialSpawn (difficulty , livingdata );
7572 }
76-
77-
7873 @ Override
7974 protected void initEntityAI ()
8075 {
@@ -86,13 +81,11 @@ protected void initEntityAI()
8681 this .tasks .addTask (2 , new EntityAIFollowOwner (this , 1.0F , 10.0F , 2.0F ));
8782 this .tasks .addTask (2 , new EntityAIFollowOwnerFlying (this , 1.0D , 5.0F , 1.0F ));
8883 this .tasks .addTask (4 , new EntityAIWatchClosest (this , EntityPlayer .class , 16.0F ));
89- this .tasks .addTask (3 , new EntityAIFollow (this , 1.0D , 3.0F , 7.0F ));
9084 this .tasks .addTask (5 , new EntityAIAttackMelee (this , 1.2D , true ));
9185 this .tasks .addTask (6 , new EntityAIMate (this , 1.5D ));
9286 this .targetTasks .addTask (1 , new EntityAIOwnerHurtByTarget (this ));
9387 this .targetTasks .addTask (2 , new EntityAIOwnerHurtTarget (this ));
9488 this .targetTasks .addTask (3 , new EntityAIHurtByTarget (this , true , new Class [0 ]));
95-
9689 }
9790
9891 @ Override
@@ -197,7 +190,7 @@ public void onLivingUpdate()
197190 this .moveHelper = new EntityMoveHelper (this );
198191 }
199192 else {
200- if (!this .isInWater () && !this .isInLove () && ! this . isAngry () ) {
193+ if (!this .isInWater () && !this .isInLove ()) {
201194 this .moveHelper = new EntityFlyHelper (this );
202195 }
203196 }
@@ -229,11 +222,6 @@ public void onLivingUpdate()
229222 }
230223
231224 }
232- if (!this .world .isRemote && this .getAttackTarget () == null && this .isAngry ())
233- {
234- this .setAngry (false );
235- }
236-
237225 }
238226
239227 @ SideOnly (Side .CLIENT )
@@ -443,19 +431,7 @@ protected void applyEntityAttributes()
443431 this .getEntityAttribute (SharedMonsterAttributes .MAX_HEALTH ).setBaseValue (30.0D );
444432 this .getAttributeMap ().registerAttribute (SharedMonsterAttributes .ATTACK_DAMAGE ).setBaseValue (2.0D );
445433 }
446- public void setAttackTarget (@ Nullable EntityLivingBase entitylivingbaseIn )
447- {
448- super .setAttackTarget (entitylivingbaseIn );
449434
450- if (entitylivingbaseIn == null )
451- {
452- this .setAngry (false );
453- }
454- else if (!this .isTamed ())
455- {
456- this .setAngry (true );
457- }
458- }
459435 /*
460436 * Config - End
461437 */
@@ -539,7 +515,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand)
539515 this .setAttackTarget ((EntityLivingBase )null );
540516 }
541517 }
542- else if (TAME_ITEMS .contains (itemstack .getItem ()) && ! this . isAngry () )
518+ else if (TAME_ITEMS .contains (itemstack .getItem ()))
543519 {
544520 if (!player .capabilities .isCreativeMode )
545521 {
@@ -572,77 +548,13 @@ else if (TAME_ITEMS.contains(itemstack.getItem()) && !this.isAngry())
572548 }
573549 public boolean canBeLeashedTo (EntityPlayer player )
574550 {
575- return ! this . isAngry () && super .canBeLeashedTo (player );
551+ return super .canBeLeashedTo (player );
576552 }
577553 public int getMaxSpawnedInChunk ()
578554 {
579555 return 8 ;
580556 }
581557
582- public boolean shouldAttackEntity (EntityLivingBase target , EntityLivingBase owner )
583- {
584- if (!(target instanceof EntityCreeper ) && !(target instanceof EntityGhast ))
585- {
586- if (target instanceof EntityFlyingLemur )
587- {
588- EntityAscendedFlyingLemur entitylemur = (EntityAscendedFlyingLemur )target ;
589-
590- if (entitylemur .isTamed () && entitylemur .getOwner () == owner )
591- {
592- return false ;
593- }
594- }
595-
596- if (target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer )owner ).canAttackPlayer ((EntityPlayer )target ))
597- {
598- return false ;
599- }
600- else
601- {
602- return !(target instanceof AbstractHorse ) || !((AbstractHorse )target ).isTame ();
603- }
604- }
605- else
606- {
607- return false ;
608- }
609- }
610-
611- /*
612- * Emotions - Start
613- */
614- @ Override
615- public void writeEntityToNBT (NBTTagCompound compound )
616- {
617- super .writeEntityToNBT (compound );
618- compound .setBoolean ("Angry" , this .isAngry ());
619- }
620- @ Override
621- public void readEntityFromNBT (NBTTagCompound compound )
622- {
623- super .readEntityFromNBT (compound );
624- this .setAngry (compound .getBoolean ("Angry" ));
625- }
626- public boolean isAngry ()
627- {
628- return (((Byte )this .dataManager .get (TAMED )).byteValue () & 2 ) != 0 ;
629- }
630- public void setAngry (boolean angry )
631- {
632- byte b0 = ((Byte )this .dataManager .get (TAMED )).byteValue ();
633-
634- if (angry )
635- {
636- this .dataManager .set (TAMED , Byte .valueOf ((byte )(b0 | 2 )));
637- }
638- else
639- {
640- this .dataManager .set (TAMED , Byte .valueOf ((byte )(b0 & -3 )));
641- }
642- }
643- /*
644- * Emotions - End
645- */
646558 public void setVariant (int variantIn )
647559 {
648560 this .dataManager .set (VARIANT , Integer .valueOf (variantIn ));
@@ -745,7 +657,7 @@ public void playRideEffect(boolean play) {
745657 this .world .spawnParticle (enumparticletypes , this .posX + (double )(this .rand .nextFloat () * this .width * 2.0F ) - (double )this .width , this .posY + 0.5D + (double )(this .rand .nextFloat () * this .height ), this .posZ + (double )(this .rand .nextFloat () * this .width * 2.0F ) - (double )this .width , d0 , d1 , d2 );
746658 }
747659 }
748- /*
749- * Particle Effects - End
750- */
660+ /*
661+ * Particle Effects - End
662+ */
751663}
0 commit comments