@ -1,14 +1,10 @@
 
			
		
	
		
		
			
				
					
					package  com.zivilon.cinder_loe.mixins.overrides ; package  com.zivilon.cinder_loe.mixins.overrides ;  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					import  com.zivilon.cinder_loe.util.Utilities ;  
			
		
	
		
		
			
				
					
					import  com.zivilon.cinder_loe.CinderLoE_Config ;  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					import  lotr.common.entity.npc.LOTREntityNPC ; import  lotr.common.entity.npc.LOTREntityNPC ;  
			
		
	
		
		
			
				
					
					import  lotr.common.entity.npc.LOTRHiredNPCInfo ; import  lotr.common.entity.npc.LOTRHiredNPCInfo ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.Entity ; import  net.minecraft.entity.Entity ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.EntityLivingBase ; import  net.minecraft.entity.EntityLivingBase ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.SharedMonsterAttributes ; import  net.minecraft.entity.SharedMonsterAttributes ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.ai.attributes.AttributeModifier ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.ai.attributes.IAttribute ; import  net.minecraft.entity.ai.attributes.IAttribute ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.ai.attributes.IAttributeInstance ; import  net.minecraft.entity.ai.attributes.IAttributeInstance ;  
			
		
	
		
		
			
				
					
					import  net.minecraft.entity.ai.attributes.RangedAttribute ; import  net.minecraft.entity.ai.attributes.RangedAttribute ;  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -28,26 +24,17 @@ import org.spongepowered.asm.mixin.Shadow;
 
			
		
	
		
		
			
				
					
					import  org.spongepowered.asm.mixin.Unique ; import  org.spongepowered.asm.mixin.Unique ;  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					import  java.util.UUID ; import  java.util.UUID ;  
			
		
	
		
		
			
				
					
					import  java.lang.reflect.Method ;  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					@Mixin ( LOTRHiredNPCInfo . class ) @Mixin ( LOTRHiredNPCInfo . class )  
			
		
	
		
		
			
				
					
					public  abstract  class  MixinLOTRHiredNPCInfo  { public  class  MixinLOTRHiredNPCInfo  {  
			
				
				
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    private  static  UUID  LEVEL_HEALTH_UUID  =  UUID . fromString ( "11111111-0000-0000-0000-000000000000" ) ; 
 
			
		
	
		
		
			
				
					
					    private  static  UUID  LEVEL_DAMAGE_UUID  =  UUID . fromString ( "22222222-0000-0000-0000-000000000000" ) ; 
 
			
		
	
		
		
			
				
					
					    private  static  UUID  LEVEL_MOVEMENT_UUID  =  UUID . fromString ( "33333333-0000-0000-0000-000000000000" ) ; 
 
			
		
	
		
		
			
				
					
					    private  static  double  HEALTH_PER_UPGRADE  =  1.0D ; 
 
			
		
	
		
		
			
				
					
					    private  static  double  DAMAGE_PER_UPGRADE  =  0.25D ; 
 
			
		
	
		
		
			
				
					
					    private  static  double  SPEED_PER_UPGRADE  =  0.0025D ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
	
		
		
			
				
					
					    @Shadow 
    @Shadow 
 
			
		
	
		
		
			
				
					
					    private  LOTREntityNPC  theEntity ; 
    private  LOTREntityNPC  theEntity ; 
 
			
		
	
		
		
			
				
					
					    @Shadow 
    @Shadow 
 
			
		
	
		
		
			
				
					
					    private  UUID  hiringPlayerUUID ; 
    private  UUID  hiringPlayerUUID ; 
 
			
		
	
		
		
			
				
					
					    @Shadow 
    @Shadow 
 
			
		
	
		
		
			
				
					
					    public  int  xpLevel  =  1 ; 
    public  int  xpLevel  =  1 ; 
 
			
		
	
		
		
			
				
					
					    @ Shadow 
    @Unique 
 
			
				
				
			
		
	
		
		
			
				
					
					    p rivate boolean  canMove  ; 
    public  int  levelUpCounter  =  0 ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    / * * 
    / * * 
 
			
		
	
		
		
			
				
					
					     *  @author 
     *  @author 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -70,9 +57,9 @@ public abstract class MixinLOTRHiredNPCInfo {
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  void  rotateLevelUpStat ( )  { 
    public  void  rotateLevelUpStat ( )  { 
 
			
		
	
		
		
			
				
					
					        LOTREntityNPC entity  =   this . theEntity ; 
        EntityLivingBase entity  =  ( EntityLivingBase )   this . theEntity ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					        switch  ( entity. hiredNPCInfo . xpLevel  %  3  )  { 
        switch  ( levelUpCounter )  { 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            case  0 : 
            case  0 : 
 
			
		
	
		
		
			
				
					
					                // +1 HP
 
                // +1 HP
 
 
			
		
	
		
		
			
				
					
					                this . addLevelUpHealthGain ( entity ) ; 
                this . addLevelUpHealthGain ( entity ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -85,7 +72,12 @@ public abstract class MixinLOTRHiredNPCInfo {
 
			
		
	
		
		
			
				
					
					                // +0.005 movement Speed
 
                // +0.005 movement Speed
 
 
			
		
	
		
		
			
				
					
					                this . increaseMovementGain ( entity ) ; 
                this . increaseMovementGain ( entity ) ; 
 
			
		
	
		
		
			
				
					
					                break ; 
                break ; 
 
			
		
	
		
		
			
				
					
					            case  3 : 
 
			
		
	
		
		
			
				
					
					                // +0.1 knockback resistance
 
 
			
		
	
		
		
			
				
					
					                this . increaseKnockbackGain ( entity ) ; 
 
			
		
	
		
		
			
				
					
					                break ; 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        levelUpCounter  =  ( levelUpCounter  + 1 )  %  4 ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    / * * 
    / * * 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -93,24 +85,30 @@ public abstract class MixinLOTRHiredNPCInfo {
 
			
		
	
		
		
			
				
					
					     *  @reason 
     *  @reason 
 
			
		
	
		
		
			
				
					
					     * / 
     * / 
 
			
		
	
		
		
			
				
					
					    @Overwrite ( remap  =  false ) 
    @Overwrite ( remap  =  false ) 
 
			
		
	
		
		
			
				
					
					    public  void  addLevelUpHealthGain ( EntityLivingBase  entity )  { 
    public  void  addLevelUpHealthGain ( EntityLivingBase  gainingEntity )  { 
 
			
				
				
			
		
	
		
		
			
				
					
					        IAttributeInstance  attr  =  entity . getEntityAttribute ( SharedMonsterAttributes . maxHealth ) ; 
        float  healthBoost  =  1.0f ; 
 
			
				
				
			
		
	
		
		
			
				
					
					        Utilities . increment_modifier ( attr ,  LEVEL_HEALTH_UUID ,  "levelup_health" ,  HEALTH_PER_UPGRADE ,  0 ) ; 
        IAttributeInstance  attrHealth  =  gainingEntity . getEntityAttribute ( SharedMonsterAttributes . maxHealth ) ; 
 
			
				
				
			
		
	
		
		
			
				
					
					        entity . heal ( 1.0f ) ; 
        attrHealth . setBaseValue ( attrHealth . getBaseValue ( )  +  ( double ) healthBoost ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					        gainingEntity . heal ( healthBoost ) ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  void  increaseDamageGain ( EntityLivingBase  entity )  { 
    public  void  increaseDamageGain ( EntityLivingBase  gainingEntity )  { 
 
			
				
				
			
		
	
		
		
			
				
					
					        IAttributeInstance  attr  =  entity . getEntityAttribute ( LOTREntityNPC . npcAttackDamageExtra ) ; 
        float  damageBoost  =  0.25f ; 
 
			
				
				
			
		
	
		
		
			
				
					
					        Utilities . increment_modifier ( attr ,  LEVEL_DAMAGE_UUID ,  "levelup_damage" ,  DAMAGE_PER_UPGRADE ,  0 ) ; 
        IAttributeInstance  attribute  =  gainingEntity . getEntityAttribute ( LOTREntityNPC . npcAttackDamageExtra ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					        attribute . setBaseValue ( attribute . getBaseValue ( )  +  ( double ) damageBoost ) ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  void  increaseMovementGain ( EntityLivingBase  entity )  { 
    public  void  increaseMovementGain ( EntityLivingBase  gainingEntity )  { 
 
			
				
				
			
		
	
		
		
			
				
					
					        IAttributeInstance  attr  =  entity . getEntityAttribute ( SharedMonsterAttributes . movementSpeed ) ; 
        float  movementBoost  =  0.0025f ; 
 
			
				
				
			
		
	
		
		
			
				
					
					        Utilities . increment_modifier ( attr ,  LEVEL_MOVEMENT_UUID ,  "levelup_speed" ,  SPEED_PER_UPGRADE ,  0 ) ; 
        IAttributeInstance  attribute  =  gainingEntity . getEntityAttribute ( SharedMonsterAttributes . movementSpeed ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					        attribute . setBaseValue ( attribute . getBaseValue ( )  +  ( double ) movementBoost ) ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					
    public  void  increaseKnockbackGain ( EntityLivingBase  gainingEntity )  { 
 
			
				
				
			
		
	
		
		
			
				
					
					
        float  kbResBoost  =  0.1f ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					        IAttributeInstance  attribute  =  gainingEntity . getEntityAttribute ( SharedMonsterAttributes . knockbackResistance ) ; 
 
			
		
	
		
		
			
				
					
					        attribute . setBaseValue ( attribute . getBaseValue ( )  +  ( double ) kbResBoost ) ; 
 
			
		
	
		
		
			
				
					
					    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    / * * 
    / * * 
 
			
		
	
		
		
			
				
					
					     *  @author 
     *  @author 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -153,25 +151,4 @@ public abstract class MixinLOTRHiredNPCInfo {
 
			
		
	
		
		
			
				
					
					        world . spawnEntityInWorld ( ( Entity ) firework ) ; 
        world . spawnEntityInWorld ( ( Entity ) firework ) ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    @Shadow 
 
			
		
	
		
		
			
				
					
					    public  void  sendClientPacket ( boolean  shouldOpenGui )  { } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    @Overwrite ( remap  =  false ) 
 
			
		
	
		
		
			
				
					
					    public  void  ready ( )  { 
 
			
		
	
		
		
			
				
					
					        this . canMove  =  true ; 
 
			
		
	
		
		
			
				
					
					        if  ( CinderLoE_Config . unit_conversion_enabled )  convert_stats ( ) ; 
 
			
		
	
		
		
			
				
					
					        sendClientPacket ( false ) ; 
 
			
		
	
		
		
			
				
					
					    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  void  convert_stats ( )  { 
 
			
		
	
		
		
			
				
					
					        LOTREntityNPC  entity  =  this . theEntity ; 
 
			
		
	
		
		
			
				
					
					        Utilities . reset_attributes ( entity ) ; 
 
			
		
	
		
		
			
				
					
					        int  level  =  entity . hiredNPCInfo . xpLevel ; 
 
			
		
	
		
		
			
				
					
					        int  health_upgrades  =  ( int ) Math . ceil ( level / 3 ) ; 
 
			
		
	
		
		
			
				
					
					        int  damage_upgrades  =  ( int ) Math . ceil ( ( level - health_upgrades ) / 2 ) ; 
 
			
		
	
		
		
			
				
					
					        int  speed_upgrades  =  level - health_upgrades - damage_upgrades ; 
 
			
		
	
		
		
			
				
					
					        Utilities . set_modifier ( entity . getEntityAttribute ( SharedMonsterAttributes . maxHealth ) ,  LEVEL_HEALTH_UUID ,  "levelup_health" ,  HEALTH_PER_UPGRADE * health_upgrades ,  0 ) ; 
 
			
		
	
		
		
			
				
					
					        Utilities . set_modifier ( entity . getEntityAttribute ( LOTREntityNPC . npcAttackDamageExtra ) ,  LEVEL_DAMAGE_UUID ,  "levelup_damage" ,  DAMAGE_PER_UPGRADE * damage_upgrades ,  0 ) ; 
 
			
		
	
		
		
			
				
					
					        Utilities . set_modifier ( entity . getEntityAttribute ( SharedMonsterAttributes . movementSpeed ) ,  LEVEL_MOVEMENT_UUID ,  "levelup_speed" ,  SPEED_PER_UPGRADE * speed_upgrades ,  0 ) ; 
 
			
		
	
		
		
			
				
					
					    } 
 
			
		
	
		
		
			
				
					
					} }