@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
if(!world.isRemote) {
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(player);
for(int i = 0; i < baubles.getSlots(); i++)
if((baubles.getStackInSlot(i) == null || baubles.getStackInSlot(i).isEmpty()) && baubles.isItemValidForSlot(i, player.getHeldItem(hand), player)) {
baubles.setStackInSlot(i, player.getHeldItem(hand).copy());
if(!player.capabilities.isCreativeMode){
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
}
onEquipped(player.getHeldItem(hand), player);
break;
}
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}