public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems){
for(EnumEffects e : EnumEffects.values()){
ItemStack stack = new ItemStack(this);
NBTTagCompound tag = Utils.getOrCreateNbtData(stack);
tag.setString("effect", e.toString());
subItems.add(stack);
}
}
public static NBTTagCompound getOrCreateNbtData(ItemStack itemStack){
NBTTagCompound ret = itemStack.getTagCompound();
if (ret == null)
{
ret = new NBTTagCompound();
itemStack.setTagCompound(ret);
}
return ret;
}
NBTTagCompound tag = Utils.getOrCreateNbtData(stack);
IIndicator capabilities = player.getCapability(IndicatorProvider.INDICATOR_CAP, null);
capabilities.addEffect(EnumEffects.getEffectByName(tag.getString("effect")));