package erebus.items;
import erebus.ModItems;
import erebus.ModMaterials;
import erebus.ModTabs;
import erebus.items.ItemMaterials.EnumType;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemBootsJump extends ItemArmor {
public ItemBootsJump() {
super(ModMaterials.ARMOR_REIN_EXOSKELETON, 2, EntityEquipmentSlot.FEET);
setCreativeTab(ModTabs.GEAR);
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack is, Entity entity, EntityEquipmentSlot slot, String type) {
if (is.getItem() == ModItems.JUMP_BOOTS)
return "erebus:textures/models/armor/jump_boots.png";
else
return null;
}
@Override
public boolean getIsRepairable(ItemStack armour, ItemStack material) {
return material.getItem() == ModItems.MATERIALS && material.getItemDamage() == EnumType.ELASTIC_FIBRE.ordinal();
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
player.fallDistance = 0.0F;
}
@SubscribeEvent
public void onEntityJump(LivingJumpEvent e) {
if (e.getEntityLiving() instanceof EntityPlayer) {
ItemStack is = ((EntityPlayer) e.getEntityLiving()).inventory.armorInventory[0];
if (is != null && is.getItem() == this && !e.getEntityLiving().isSneaking())
e.getEntityLiving().motionY += 0.4D;
}
}
}