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 ;
2015-04-08 13:52:51 +00:00
import net.minecraft.client.renderer.texture.IIconRegister ;
2015-01-10 17:23:41 +00:00
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 ;
2015-04-08 13:52:51 +00:00
import net.minecraft.util.IIcon ;
import WayofTime.alchemicalWizardry.ModItems ;
2015-01-10 17:23:41 +00:00
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
{
2015-04-08 13:52:51 +00:00
private static IIcon helmetIcon ;
private static IIcon plateIcon ;
private static IIcon leggingsIcon ;
private static IIcon bootsIcon ;
2015-01-10 17:23:41 +00:00
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
2015-04-08 13:52:51 +00:00
@Override
@SideOnly ( Side . CLIENT )
public void registerIcons ( IIconRegister iconRegister )
{
this . itemIcon = iconRegister . registerIcon ( " AlchemicalWizardry:SheathedItem " ) ;
this . helmetIcon = iconRegister . registerIcon ( " AlchemicalWizardry:OmegaHelmet_wind " ) ;
this . plateIcon = iconRegister . registerIcon ( " AlchemicalWizardry:OmegaPlate_wind " ) ;
this . leggingsIcon = iconRegister . registerIcon ( " AlchemicalWizardry:OmegaLeggings_wind " ) ;
this . bootsIcon = iconRegister . registerIcon ( " AlchemicalWizardry:OmegaBoots_wind " ) ;
}
@Override
@SideOnly ( Side . CLIENT )
public IIcon getIconFromDamage ( int par1 )
{
if ( this . equals ( ModItems . boundHelmetWind ) )
{
return this . helmetIcon ;
}
if ( this . equals ( ModItems . boundPlateWind ) )
{
return this . plateIcon ;
}
if ( this . equals ( ModItems . boundLeggingsWind ) )
{
return this . leggingsIcon ;
}
if ( this . equals ( ModItems . boundBootsWind ) )
{
return this . bootsIcon ;
}
return this . itemIcon ;
}
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
}