package micdoodle8.mods.galacticraft.core.items;
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats;
import micdoodle8.mods.galacticraft.core.proxy.ClientProxyCore;
import micdoodle8.mods.galacticraft.core.util.EnumSortCategoryItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemOxygenGear extends Item implements ISortableItem
{
public ItemOxygenGear(String assetName)
{
super();
this.setUnlocalizedName(assetName);
}
@Override
public CreativeTabs getCreativeTab()
{
return GalacticraftCore.galacticraftItemsTab;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return ClientProxyCore.galacticraftItem;
}
@Override
public EnumSortCategoryItem getCategory(int meta)
{
return EnumSortCategoryItem.GEAR;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (player instanceof EntityPlayerMP)
{
GCPlayerStats stats = GCPlayerStats.get(player);
ItemStack gear = stats.getExtendedInventory().getStackInSlot(1);
if (gear == null)
{
stats.getExtendedInventory().setInventorySlotContents(1, itemStack.copy());
itemStack.stackSize = 0;
}
}
return itemStack;
}
}