2015-01-10 17:23:41 +00:00
package WayofTime.alchemicalWizardry.common.items.armour ;
2015-03-19 19:26:03 +00:00
import java.util.UUID ;
2015-01-10 17:23:41 +00:00
import net.minecraft.client.model.ModelBiped ;
import net.minecraft.entity.Entity ;
2015-03-19 19:26:03 +00:00
import net.minecraft.entity.SharedMonsterAttributes ;
import net.minecraft.entity.ai.attributes.AttributeModifier ;
2015-01-10 17:23:41 +00:00
import net.minecraft.item.ItemStack ;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind ;
2015-03-19 19:26:03 +00:00
import com.google.common.collect.HashMultimap ;
import com.google.common.collect.Multimap ;
2015-01-23 13:26:39 +00:00
import cpw.mods.fml.relauncher.Side ;
import cpw.mods.fml.relauncher.SideOnly ;
2015-01-10 17:23:41 +00:00
public class OmegaArmourWind extends OmegaArmour
{
public OmegaArmourWind ( int armorType )
{
super ( armorType ) ;
2015-03-19 19:26:03 +00:00
this . storeYLevel = true ;
2015-01-10 17:23:41 +00:00
}
@Override
public String getArmorTexture ( ItemStack stack , Entity entity , int slot , String type )
{
return " alchemicalwizardry:models/armor/OmegaWind.png " ;
}
@Override
2015-01-23 13:26:39 +00:00
@SideOnly ( Side . CLIENT )
2015-01-10 17:23:41 +00:00
public ModelBiped getChestModel ( )
{
return new ModelOmegaWind ( 1 . 0f , true , true , false , true ) ;
}
@Override
2015-01-23 13:26:39 +00:00
@SideOnly ( Side . CLIENT )
2015-01-10 17:23:41 +00:00
public ModelBiped getLegsModel ( )
{
return new ModelOmegaWind ( 0 . 5f , false , false , true , false ) ;
}
2015-03-19 19:26:03 +00:00
@Override
public Multimap getAttributeModifiers ( ItemStack stack )
{
Multimap map = HashMultimap . create ( ) ;
int yLevel = this . getYLevelStored ( stack ) ;
map . put ( SharedMonsterAttributes . maxHealth . getAttributeUnlocalizedName ( ) , new AttributeModifier ( new UUID ( 85212 /** Random number **/ , armorType ) , " Armor modifier " + armorType , getDefaultHealthBoost ( ) * getHealthBoostModifierForLevel ( yLevel ) , 0 ) ) ;
return map ;
}
public float getDefaultHealthBoost ( )
{
switch ( this . armorType )
{
case 0 :
return 2 . 5f ;
case 1 :
return 4 ;
case 2 :
return 3 . 5f ;
case 3 :
return 2 ;
}
return 0 . 25f ;
}
public float getHealthBoostModifierForLevel ( int yLevel )
{
return ( float ) Math . sqrt ( ( ( float ) yLevel ) / 64f ) * 1 . 5f - 1 ;
}
2015-01-10 17:23:41 +00:00
}